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
def eval_in_file(source, options={}) | |
suffix = options[:suffix] || Time.now.strftime("%s%N") | |
path = options[:path] || "/tmp/" | |
result = nil | |
filename = "#{path}eval-#{suffix}.rb" | |
file = File.new(filename, 'w+') | |
file.write(source) | |
file.rewind | |
begin |
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/bash | |
OUTDIR=~/Desktop/moby | |
BASE="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks" | |
mkdir -p ${OUTDIR} | |
cd ${BASE} | |
for dir in * | |
do |
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
[UIView transitionWithView:self.view | |
duration:0.25 | |
options:UIViewAnimationOptionsTransitionCrossDissolve | |
animations:^{ | |
[self.view addSubview:overlay]; | |
} | |
completion:nil]; |
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
#!/usr/bin/env ruby | |
require "net/http" | |
require "uri" | |
url = 'http://example.com/submissions.json' | |
token = 'TOKEN HERE' | |
boundary = "pop-pop" | |
uri = URI.parse(url) |
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
function pow { | |
if [ -d "`cd $1; pwd`" ]; then | |
ln -s "`cd $1; pwd`" ~/.pow/ | |
fi | |
} |
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
if [ -x `which brew` ]; then | |
macvim_version=`brew list --versions macvim | sed 's/.* \([0-9\.\-]*\)$/\1/'` | |
if [ -n "${macvim_version}" ]; then | |
alias vim=`brew --prefix`/Cellar/macvim/${macvim_version}/MacVim.app/Contents/MacOS/Vim | |
fi | |
fi |
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/bash | |
basedir="${HOME}/freeciv-build" | |
srcdir="${basedir}/freeciv-web" | |
destdir="${basedir}/build" | |
# User will need permissions to create a database | |
mysql_user="root" | |
mysql_pass="changeme" |
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 | |
# | |
# Copyright (c) 2002-2004 Michael Telahun Makonnen. All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# 1. Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright |
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.contrib import admin | |
from django.contrib.auth.models import User | |
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin | |
from forms import UserChangeForm | |
class UserAdmin(BaseUserAdmin): | |
list_display = ('username', 'last_name', 'first_name', 'is_superuser', 'is_staff') |
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
#!/usr/bin/env python | |
""" | |
This script aims at providing a simple way to bootstrap a self-contained django project. | |
In short, it makes a few trivial decisions for you. | |
To those who use the Django framework this may seem a bit unecessary, but I believe that | |
it could be easier to get started with django, without having to impose minor decisions | |
on new users such as where to place templates and basic media files. |