Skip to content

Instantly share code, notes, and snippets.

View vigo's full-sized avatar
🕶️
I may be slow to respond.

Uğur Özyılmazel vigo

🕶️
I may be slow to respond.
View GitHub Profile
@jballanc
jballanc / confused.rb
Last active August 29, 2015 14:16
Crazy...
dislike = ->() {}
like = ->(thing = define_method(:confused, &dislike) && "ice cream") { puts "I like #{thing}" }
dislike = ->(thing = define_method(:confused, &like) && "broccoli") { puts "I don't like #{thing}" }
define_method(:confused, &like)
confused("ayran")
confused
confused("homework")
confused
confused("kunefe")
@FloorD
FloorD / gist:944d152fdd655cae03e8
Last active August 29, 2015 14:19
A recap of ROSSConf Vienna, April 25 2015

###The ROSSConf project, or: helping Open Source help Open Source

Last April Saturday ROSSConf Vienna took place. Sixty registered participants, some loose canons, 5 projects, 6 maintainers, 8-ish team members, 1 baby all in one coworking space. Here's what happened.

*credit: Manuel Gruber*

####In the beginning October last year, at arrrrcamp, I came up with the concept for ROSSConf. Having attended 1001 tech conferences (I haven't kept count) I concluded that I'm always missing something. I found myself listening to a talk and wishing I could contribute to the project discussed but the internet connection wasn't sufficient for cloning the repo, nor was there time to hack on the project as the next talk was about to start. And, I figured, I'd need some time to get into the project and the contributing etiquette before being able to contribute.

@rafaelss
rafaelss / gist:3700977
Created September 11, 2012 19:04
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. pg_ctl -D /usr/local/var/postgres stop -s -m fast
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@anderssvendal
anderssvendal / README.md
Created October 29, 2012 10:20
ubuntu + unicorn + sinatra
@fkei
fkei / example-gunicorn.py
Last active December 22, 2015 04:49
gunicorn sample config
import multiprocessing
# Turn on debugging in the server. [False]
debug=True
# Install a trace function that spews every line executed by the server. [False]
spew=False
# The Access log file to write to. [None]
#accesslog='/var/log/gunicorn.access.log'
@ukyo
ukyo / gist-toc.js
Created June 27, 2012 01:31
toc tree for gist
(function(l, l2, s) {
l2 = l2 || 6;
NodeList.prototype.forEach = [].forEach;
NodeList.prototype.slice = [].slice;
var toc = document.createElement('div');
var headerLevel = l || 2;
var tocStyle = s || 'ul';
@vigo
vigo / bunde_complete.sh
Last active July 20, 2016 02:32
Bash completion for bundle
_bundler_complete()
{
if [[ ! `which bundle` ]]; then
return
fi
local cur prev commands
commands="help install update package exec config check list show outdated console open viz init gem platform"
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@czarneckid
czarneckid / Zero downtime deploys with gunicorn.markdown
Last active August 31, 2016 17:42
Zero downtime deploys with gunicorn

Zero downtime deploys with gunicorn

Below are the actual files we use in one of our latest applications at Agora Games to achieve zero downtime deploys with gunicorn. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).

Salient points for each file:

  • gunicorn.py: The pre_fork function looks for gunicorn's old PID file in the proper file and sends the proper QUIT signal to the old process once the new process is running.
  • sv-gunicorn-run.jinja: This is the runit template we use in our Salt-managed infrastructure for handling the application process management. You could just as easily convert this to a non-templatized version.
@tritonrc
tritonrc / ldap_admin.rb
Created January 17, 2011 19:55
Simple Sinatra based LDAP admin tool
require 'rubygems'
require 'sinatra'
require 'net-ldap'
require 'digest/sha1'
require 'base64'
require 'haml'
LDAP_HOST = 'localhost'
ADMIN_DN = 'cn=admin,dc=company,dc=com'
{
"total": 1007,
"pages": [
{
"page": 1,
"videos": [
{
"name": "Explore IOT Business Scenarios and their Technology Architectures",
"href": "https://vimeo.com/182739791",
"duration": "44:07",