Skip to content

Instantly share code, notes, and snippets.

View rpond-pa's full-sized avatar

Randy Pond rpond-pa

View GitHub Profile
@bhameyie
bhameyie / haproxy.cfg
Last active November 28, 2023 22:30
Sample haproxy config
##based on Mesosphere Marathon's servicerouter.py haproxy config
global
daemon
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
tune.ssl.default-dh-param 2048
defaults
@vodafon
vodafon / Readme.md
Last active January 11, 2017 19:39
Linking #GoLang lib in #Ruby
go build -buildmode=c-shared -o sum.so sum.go
ruby link.rb
Jeff Atwood, @codinghorror, “Please Don't Learn to Code" blog.codinghorror.com/please-dont-learn-to-code
Zed Shaw, @zedshaw, ”Please Don't Become Anything, Especially Not a Programmer" http://learncodethehardway.org/blog/MAY_15_2012.html
Stephanie Morillo, @radiomorillo, RubyWanKenoobie.tumblr.com, alterconf.com/speakers/stephanie-morillo
Sarah Mei, @sarahmei, http://www.sarahmei.com/blog/2014/07/15/programming-is-not-math/
Sara Simon, @sarambsimon, “Seven Months Later”, blog.turing.io/2015/01/29/seven-months-later/
Kylie Stradley, @kyfast, “Amelia Bedelia Learns to Code”, http://railsconf.com/program#prop_1010
Sasha Laundy, @SashaLaundy, “Your Brain's API: Giving and Getting Technical Help”, https://www.youtube.com/watch?v=hY14Er6JX2s
Monica F. Cox, Ph.D., @monicafcox, “Professionally Prepared but Not Pioneer Prepared”, alterconf.com/speakers/monica-f-cox
Ashley Nelson-Hornstein, @ashleynh, “On Heroes”, blog.ashleynh.me/on-heroes
Dominic M. Liddel, @dominicmliddell, “Lessons Learned While Working to Build B
# Multiple inheritance with Modules as an alternative to injected composition
# from Sandi Metz's talk [Nothing is Something](http://confreaks.tv/videos/bathruby2015-nothing-is-something)
# Like Sandi's 'direct' DI method this has behavior outside of the base class
# that gets composed together. However in this gist I compose modules in class
# definitions instead of injecting collaborators.
# Tradeoffs between this and Sandi's version are that in this case the API consumer doesn't
# have to know how to make a RandomEchoHouse (no `house = House.new(formatter: Whatever.new)`),
# but also the API consumer can't make anything not already accounted for either.
@madzhuga
madzhuga / Gemfile
Created April 5, 2015 18:25
Minimal Rails 4.2 application
source 'https://rubygems.org'
gem 'thin'
gem 'rails', '4.2.0'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
@austinhyde
austinhyde / js-observables-binding.md
Last active August 16, 2023 18:19
Vanilla JavaScript Data Binding

Observables

You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:

var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }

console.log(getN()); // 5

setN(10);

@demisx
demisx / angularjs-providers-explained.md
Last active March 17, 2024 11:09
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do
@brasic
brasic / gist:8788958
Last active August 29, 2015 13:55 — forked from trcarden/gist:3295935
simulating a real https site in localhost:3000 (OSX)
running https://yourssldomain.com
# generate keys, run in ~/.sslcert
openssl genrsa -des3 -out server.orig.key 2048
openssl rsa -in server.orig.key -out server.key
openssl req -new -key server.key -out server.csr
# set Common Name: yourssldomain.com
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
echo "127.0.0.1 yourssldomain.com" | sudo tee -a /private/etc/hosts
@javan
javan / data-attr-hash.md
Created July 3, 2013 19:17
Supplying data-* html attributes as a hash with Rails helpers.

Just OK

link_to(person.name, person_path(person), "data-thing" => 1, "data-other-thing" => true)

<a data-other-thing="true" data-thing="1" href="/people/127326141-david-heinemeier">David Heinemeier Hansson</a>

Awesome!