Discover gists
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
<?php | |
// The year start date... | |
define("YEARSTART", mktime(0, 0, 0, 10, 5, 2007), FALSE); | |
// Calculates the week number from the start of the year as set in the | |
// general configuration files. Returns an array containing the uni week | |
// number [0], the term name as a string [1] and a boolean if the current | |
// week is during a holiday [2]... | |
function universityWeek() { |
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 | |
# Fuck this, I don't know bash. | |
GENERAL=2.6 | |
SPECIFIC=2.6b2 | |
BZFILE="Python-$SPECIFIC.tar.bz2" | |
BZURL="http://www.python.org/ftp/python/$GENERAL/$BZFILE" | |
ASCFILE="Python-$SPECIFIC.tar.bz2.asc" |
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 can_haz_link?(link) | |
(/^\//.match(link) || Regexp.compile("^"+@base).match(link)) && !@collection.include?(link) | |
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
import flash.external.ExternalInterface; | |
public class AS2JS{ | |
public var id:String; | |
public var anonymouseJS:String; | |
public var data:Object; | |
public function AS2JS(id:String){ | |
this.id = id; | |
this.data = ExternalInterface.call("as2js['" + this.id + "'].setup", id); |
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
// ==UserScript== | |
// @name Last.fm unlocalize | |
// @namespace http://lowreal.net/ | |
// @include http://www.lastfm.jp/* | |
// ==/UserScript== | |
location.href = "http://www.last.fm/" + location.pathname + "?setlang=en"; |
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
// ==UserScript== | |
// @name hatena_bookmark_cmptag | |
// @namespace http://github.com/monmon | |
// @description 「おすすめタグ」と「キーワード」に自分のタグがあれば目立たせる | |
// @include http://b.hatena.ne.jp/add* | |
// @include http://b.hatena.ne.jp/*/edit* | |
// ==/UserScript== | |
(function(){ |
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
NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; | |
NSLog(@"documentsDirectory: %@", resourcePath); | |
NSString *fontPath = [NSString stringWithFormat: @"%@/MinionPro-Regular.otf", resourcePath]; | |
NSURL *fontURL = [NSURL fileURLWithPath: fontPath isDirectory: NO]; | |
fontProvider = CGDataProviderCreateWithURL((CFURLRef) fontURL); | |
NSLog(@"%@, fontProvider = %p", fontURL, fontProvider); | |
mainFont = CGFontCreateWithDataProvider(fontProvider); |
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 [ "${ARCHS}" = "armv6" ]; then | |
CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate codesign -s "Jjgod Jiang" -f ${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME} | |
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
<?php | |
// @todo Make this a bit more generic and put into elements/tabs.ctp --felix | |
$tabs = array( | |
'Overview' => array('action' => 'view'), | |
'News' => array('count' => $newsCount), | |
'Discussions' => array('count' => $newsCount), | |
'Conferences' => array('count' => $newsCount), | |
'Conditions' => array(), | |
'Related Drugs' => array(), | |
); |
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
<?php | |
// @todo Make this a bit more generic and put into elements/tabs.ctp --felix | |
$tabs = array( | |
'Overview' => array('action' => 'view'), | |
'News' => array('count' => $newsCount), | |
'Discussions' => array('count' => $newsCount), | |
'Conferences' => array('count' => $newsCount), | |
'Conditions' => array(), | |
'Related Drugs' => array(), | |
); |