Skip to content

Instantly share code, notes, and snippets.

@endolith
endolith / Has weird right-to-left characters.txt
Last active March 28, 2024 04:56
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@bobthecow
bobthecow / .gitconfig
Created June 10, 2010 15:30
Git aliases
[alias]
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
lc = log ORIG_HEAD.. --stat --no-merges
smash = merge --no-commit --log
eat = branch -M
prune-all = !git remote | xargs -n 1 git remote prune
whois = "!sh -c 'git log -i --pretty=\"format:%an <%ae>\" --author=\"$1\" | sort -u' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
import redis
from django.conf import settings
from django.core.signals import request_finished
try:
from eventlet.corolocal import local
except ImportError:
from threading import local
#!/usr/bin/env ruby
require 'rubygems'
require 'chef'
require 'chef/client'
require 'chef/run_context'
Chef::Config[:solo] = true
Chef::Config[:log_level] = :info
Chef::Log.level(:info)
file "/etc/apt/sources.list.d/my-ppa.list" do
content "deb http://ppa.launchpad.net/USER/ppa/ubuntu lucid main"
owner "root"
group "root"
mode 0644
end
execute "Add PPA key" do
command "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY"
not_if "apt-key list | grep -xq '.*1024R/KEY.*'"
@apsoto
apsoto / knife-config.staging.rb
Created November 22, 2010 19:21
Managing different chef environments using git branches
log_level :debug
log_location STDOUT
validation_client_name 'channels-staging-validator'
validation_key './.chef/channels-staging-validator.pem'
chef_server_url 'https://api.opscode.com/organizations/channels-staging'
cache_options( :path => './.chef/channels-staging-checksums' )
@mm53bar
mm53bar / application_controller.rb
Created December 23, 2010 20:31
Code to roll your own authentication!
class ApplicationController < ActionController::Base
include AuthenticateUser
before_filter :authenticate_user!
end
@jezdez
jezdez / custom_settings.py
Created December 28, 2010 12:08
support for legacy locations of app media (in APP/media/)
# Add this to your settings.py
STATICFILES_FINDERS += (
'mysite.finders.AppMediaFinder'
)
@progrium
progrium / urlfetch_intercept.py
Created February 9, 2011 06:15
wsgi_intercept for app engine's urlfetch
""" Monkey patch to hit wsgi apps when using urlfetch
This will monkey patch App Engine's urlfetch.fetch with a fetch that hits a local
wsgi app registered with add_intercept. This module is inspired by and borrows
code from the wsgi-intercept project, which doesn't work with App Engine.
This is intended only for the local SDK environment for unit tests.
Usage:
@jbz
jbz / knife.rb
Created February 16, 2011 17:08
knife.rb that switches Opscode orgs/validators based on git branch
# This knife.rb orig. provided by jtimberman@opscode.com - but any mistakes are mine!
current_dir = File.dirname(__FILE__)
platform = "https://api.opscode.com/organizations"
require 'grit'
branch = Grit::Repo.new("#{current_dir}/..").head.name
case branch