This file contains hidden or 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/python | |
# -*- coding:utf-8 -*- | |
import objc | |
from Cocoa import * | |
def bigText(text): | |
attrs = {NSFontAttributeName : NSFont.boldSystemFontOfSize_(200.0)} | |
attributedString = NSAttributedString.alloc().initWithString_attributes_(text, attrs) | |
frame = attributedString.boundingRectWithSize_options_(NSMakeSize(640.0, 1600.0), 0) |
This file contains hidden or 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 math | |
def solve(x): | |
left = []; right = []; nums = [1]; i = 0 | |
while x > sum(nums): i += 1; nums.append(3 ** i) | |
for num in nums: | |
r = int(math.ceil(float(x - sum(nums[:nums.index(num)])) / num)) % 3 | |
if r == 1: left.append(num) | |
elif r == 2: right.append(num) | |
return sorted(left), sorted(right) |
This file contains hidden or 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
l = [] | |
for i in range(0,1000): | |
if i % 3 == 0 or i % 5 == 0: l.append(i) | |
print sum(l) |
This file contains hidden or 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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Pastels on Dark.tmTheme", | |
"font_size": 18, | |
"tab_size": 4, | |
"translate_tabs_to_spaces": false, | |
"rulers": [78], | |
"spell_check": true, | |
"trim_trailing_white_space_on_save": true | |
} |
This file contains hidden or 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
export COMMAND_LINE_INSTALL=1 | |
open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg" | |
http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux |
This file contains hidden or 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
fahrenheit :: RealFloat a => a -> a | |
fahrenheit c = c * (9 / 5) + 32 | |
celsius :: RealFloat a => a -> a | |
celsius f = (f - 32) * 9 / 5 |
This file contains hidden or 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
object Converter { | |
def CelcusToFahrenhei(TC:Double):Double = { | |
return TC * (9.0/5.0) + 32.0; | |
} | |
def FarentheitToCelcus(TF:Double):Double = { | |
return (5.0/9.0) * (TF - 32.0); | |
} | |
} |
This file contains hidden or 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 | |
/* | |
* A tiny parser which parses ID3 tags and MP3 frames. | |
*/ | |
function parseMP3($mp3file) { | |
function _parseID3TagsV2($data) { | |
define("HEADER_LENGTH", 10); |
This file contains hidden or 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 | |
# encoding: utf-8 | |
import sys | |
import getopt | |
import os.path | |
import objc, Cocoa, QTKit | |
help_message = '''Input the path of the file that you want to validate.''' |
This file contains hidden or 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
(ns flow.core | |
(:gen-class) | |
(:use [overtone.core][overtone.inst.piano]) | |
) | |
(definst kick [freq 120 dur 0.3 width 0.5] | |
(let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) | |
env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) | |
sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) | |
src (sin-osc freq-env) |