Skip to content

Instantly share code, notes, and snippets.

View sanderpick's full-sized avatar
🎟️
Got me a ticket to ride

Sander Pick sanderpick

🎟️
Got me a ticket to ride
View GitHub Profile
@OliverJAsh
OliverJAsh / foo.ts
Created December 10, 2017 21:34
Luxon TypeScript typings
declare module 'luxon' {
namespace luxon {
type DateTimeFormat = any;
type ZoneOptions = {
keepCalendarTime?: boolean;
};
type ToFormatOptions = {
round: boolean;
};
@jsmouret
jsmouret / struct.go
Last active November 1, 2022 10:06
Convert map[string]interface{} to a google.protobuf.Struct
package pb
import (
"fmt"
"reflect"
st "github.com/golang/protobuf/ptypes/struct"
)
// ToStruct converts a map[string]interface{} to a ptypes.Struct
@wearhere
wearhere / enable-websockets.config
Last active July 8, 2020 09:26
Patches AWS Elastic Beanstalk's default nginx configuration to support websockets, for use with an Application Load Balancer.
container_commands:
enable_websockets:
command: |
sed -i '/\s*proxy_set_header\s*Connection/c \
proxy_set_header Upgrade $http_upgrade;\
proxy_set_header Connection "upgrade";\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
@yustam
yustam / redis.config
Last active December 16, 2023 06:45
Install Redis on Elastic Beanstalk
packages:
yum:
gcc-c++: []
make: []
sources:
/home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz
commands:
redis_build:
command: make
cwd: /home/ec2-user/redis-2.8.4
@michiakig
michiakig / ants.clj
Created July 19, 2011 22:37
Clojure ant sim from Rich Hickey
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;dimensions of square world