Skip to content

Instantly share code, notes, and snippets.

🖥
C64/Amiga Scener/Coder

Uğur Özyılmazel vigo

🖥
C64/Amiga Scener/Coder
Block or report user

Report or block vigo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View confused.rb
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 Aug 29, 2015
A recap of ROSSConf Vienna, April 25 2015
View gist:944d152fdd655cae03e8

###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.

@armonge
armonge / fields.py
Created Jul 18, 2011
A Django custom modelfield, formfield and formwidget to select and save a set of geographic coordinates using Google Maps
View fields.py
class GoogleMapMarker(object):
def __init__(self, latitude, longitude):
self.latitude = latitude
self.longitude = longitude
def __unicode__(self):
return '%f,%f'%(self.latitude, self.longitude)
def __len__(self):
return len(self.__unicode__())
@rafaelss
rafaelss / gist:3700977
Created Sep 11, 2012
PostgreSQL 9.2 upgrade steps
View gist:3700977
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 Oct 29, 2012
ubuntu + unicorn + sinatra
View README.md
@fkei
fkei / example-gunicorn.py
Last active Dec 22, 2015
gunicorn sample config
View example-gunicorn.py
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 Jun 27, 2012
toc tree for gist
View gist-toc.js
(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 Jul 20, 2016
Bash completion for bundle
View bunde_complete.sh
_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 Aug 31, 2016
Zero downtime deploys with gunicorn
View Zero downtime deploys with gunicorn.markdown

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 Jan 17, 2011
Simple Sinatra based LDAP admin tool
View ldap_admin.rb
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'
You can’t perform that action at this time.