This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service{"refrigerator": | |
ensure => running, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV['VAGRANT_NO_PLUGINS'] = 'true' | |
Vagrant.configure("2") do |v| | |
v.vm.box = "yungsang/boot2docker" | |
v.vm.box_version = ">= 1.3.7" | |
v.vm.box_check_update = false | |
v.vm.network :forwarded_port, guest: 5000, host: 60050 | |
v.vm.network :forwarded_port, guest: 8500, host: 60085 | |
v.vm.network :forwarded_port, guest: 8080, host: 60080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Cleanup World of Warcraft AddOns folder from embedded libraries, | |
# only if those are installed individually or as part of a library pack (eg. Ace3) | |
# | |
# Usual dir on a Mac OS X is at : | |
# ~/Applications/World of Warcraft/Interface/AddOns | |
# | |
# Useful shell alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see mail reply in http://groups.google.com/group/haml/msg/12f63d9dff34a1d5 | |
# with explanation about how/why this works better than rails 2.2 | |
module Rails | |
class VendorGemSourceIndex | |
def gemspec_filename(d) | |
File.join(d,"#{File.basename(d)}.gemspec") | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cert_name="mycompany" | |
decrypted_rsa_key=$(mktemp `dirname $0`/${cert_name}-com-server-key-UNENCRYPTED.pem.XXXXXXX) | |
trap "rm -rf $decrypted_rsa_key" EXIT | |
openssl rsa -in ${cert_name}-com-server-key.pem -out $decrypted_rsa_key | |
# The certificate chain must start with the immediate signing certificate, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.db import connection | |
class SqldumpMiddleware(object): | |
def process_response(self, request, response): | |
if settings.DEBUG and 'sqldump' in request.GET: | |
response.content = str(connection.queries) | |
response['Content-Type'] = 'text/plain' | |
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jinja2 | |
from django.template.loader import BaseLoader | |
from django.template.loaders.app_directories import app_template_dirs | |
from django.template import TemplateDoesNotExist, Origin | |
from django.core import urlresolvers | |
from django.conf import settings | |
import datetime | |
import urllib | |
from django.utils.timesince import timesince, timeuntil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HostnameMiddleware(object): | |
"""Middleware that adds a header X-Hostname to erroneous pages.""" | |
def process_response(self, request, response): | |
try: | |
if response.status_code != 200: | |
import socket | |
hostname = socket.gethostname() | |
addresses = ",".join( socket.gethostbyname_ex(hostname)[2] ) | |
response['X-Host-Name'] = hostname | |
response['X-Host-IP'] = addresses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* definition */ | |
(function($){ | |
$.fn.each_slice = function( iterator ) { | |
var index, objects; | |
objects = this; | |
for (index=0; index<=objects.length-1; index++) { | |
var single = objects.slice(index, index+1); | |
this = single; | |
iterator(single); | |
} |
OlderNewer