Skip to content

Instantly share code, notes, and snippets.

View eadz's full-sized avatar

Eaden McKee eadz

View GitHub Profile
@liamstask
liamstask / middleman s3 deploy
Created February 19, 2014 17:59
a script for deploying a middleman site to s3. any gzip'd files have their extension removed so that s3 can serve them directly without another server required to perform content negotiation.
#!/usr/bin/env python
import os, shutil, subprocess
SITE = 'build/'
BUCKET = 's3://mybucket.com/'
CMD = ['s3cmd', '-c', os.path.expanduser('~/.s3cfg-myconfig'), 'sync', '--acl-public', '--reduced-redundancy']
CACHE_10_WEEKS = "Cache-Control: max-age=6048000"
@parndt
parndt / gist:882317
Created March 22, 2011 23:24
Gemfile without refinerycms doing all the magic authentication
# This is how to use Refinery CMS without our authentication
# What is happening here is I'm manually listing all of the other engines
# You will need to comply with all of the methods that anything else in Refinery is accessing
# That were being provided by refinerycms-authentication
gem 'refinerycms-dashboard', '~> 2.0.4'
gem 'refinerycms-images', '~> 2.0.4'
gem 'refinerycms-pages', '~> 2.0.4'
gem 'refinerycms-resources', '~> 2.0.4'
#!/bin/bash
set -e
while inotifywait -e modify -r *.go; do
go build || true
done
@jyap808
jyap808 / decrypt_gpg_armor_private_key.go
Created January 8, 2014 01:25
Decrypting an ASCII armored GPG encrypted string using a private key (no passphrase) in ASCII armor format
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"code.google.com/p/go.crypto/openpgp/armor"
"fmt"
"io/ioutil"
"log"
)
@jyap808
jyap808 / public_key_decrypt_gpg_base64.go
Created January 9, 2014 20:32
Decrypting a base64 GPG public key encrypted string using a passphrase protected private key in ASCII armor format
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
)
@jyap808
jyap808 / public_key_encrypt_gpg_base64.go
Last active May 21, 2021 16:39
Public key encrypting a string into GPG format and outputting it in base64 encoding
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
)
@sapessi
sapessi / README.md
Last active September 17, 2021 21:32
continuous deployment of Golang Gin application in AWS Lambda and Amazon API Gateway with CodePipeline/CodeBuild

You can use CodePipeline and CodeBuild to create a continuous deployment/integration pipeline for serverless applications build on AWS Lambda and Amazon API Gateway. This sample application is written in Go with the Gin framework and uses the eawsy API Gateway proxy shim: https://github.com/eawsy/aws-lambda-go-net

We initially detailed our methodology in this blog post: https://aws.amazon.com/blogs/compute/continuous-deployment-for-serverless-applications/

We have used the shim technology created by eawsy to run Golang applications inside AWS Lambda (https://github.com/eawsy/aws-lambda-go-shim) and created a container that can be used with CodeBuild as part of our original pipeline template.

The container is available on DockerHub and is called sapessi/aws-lambda-go18-codebuild:latest. To use this container, simply change the Image property of the CodeBuild project environment.

The pipeline template, sample app, buildspec and SAM files are attached to this gist.

// CAN Send Example
//
#include <mcp_can.h>
#include <SPI.h>
long unsigned int rxId;
unsigned char len = 0;
unsigned char rxBuf[8];
char msgString[128]; // Array to store serial string
@eadz
eadz / ruby-redux.rb
Last active October 4, 2022 21:24
Redux in Ruby
# Redux in Ruby
class Store
attr_reader :state
def initialize(initial_state, *reducers)
@reducers = reducers
@state = initial_state || {}
end
@clhenrick
clhenrick / .block
Last active June 14, 2023 09:45
Custom tiles in Google Maps
license: apache-2.0