Skip to content

Instantly share code, notes, and snippets.

@jiphex
jiphex / uniweek.php
Created July 26, 2008 10:33
Week calculator for Lancaster University
<?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() {
@jeremyBanks
jeremyBanks / python.bash
Created July 26, 2008 10:51
[2010-01] downloading and verifying python, noobing bash and gpg
#!/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"
def can_haz_link?(link)
(/^\//.match(link) || Regexp.compile("^"+@base).match(link)) && !@collection.include?(link)
end
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);
// ==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";
// ==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(){
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);
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
<?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(),
);
<?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(),
);