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
func indexOfObject<T: Equatable>(array: Array<T>, object: T) -> Int? { | |
var i: Int | |
for i = 0; i < array.count; ++i { | |
if (array[i] == object) { | |
return i | |
} | |
} | |
return 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
override func awakeFromNib() { | |
let voices = NSSpeechSynthesizer.availableVoices() as Array<String> | |
var defaultRow = indexOfObject(voices, NSSpeechSynthesizer.defaultVoice()) | |
if let row = defaultRow { | |
self.tableView.scrollRowToVisible(row) | |
} | |
} |
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
>Quix Commands | |
quiet http://quietube.com/v.php/%r Quietube | |
alt javascript:for(var%20imCt=0;document.images%5BimCt%5D;imCt++)%7Bvoid(document.images%5BimCt%5D.onclick=function%20()%20%7Bif(this.title)%7Bif((window.brbanta=prompt('Image%20title%20text:%5Cn(Click%20OK%20to%20insert%20this%20text%20before%20the%20image)',this.title))&&this.parentNode)%7Bthis.parentNode.insertBefore(document.createTextNode('%20'+brbanta+'%20'),this);%7D%7Delse%20if(this.alt)%7Bif((window.brbanta=prompt('Image%20alt%20text:%5Cn(Click%20OK%20to%20insert%20this%20text%20before%20the%20image)',this.alt))&&this.parentNode)%7Bthis.parentNode.insertBefore(document.createTextNode('%20'+brbanta+'%20'),this);%7D%7D%20else%20%7Balert('There%20is%20no%20title%20or%20alt%20text%20for%20this%20image');%7D%7D);%7D Show image alt text | |
down http://downforeveryoneorjustme.com/%d Is this site down? |
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/python | |
import sys | |
import string | |
commandLine = raw_input("") | |
timesToPrint = eval(commandLine.split()[0]) | |
sys.stdout.write("switch ($1) {\n\tcase: $2\n\t\t$0\n") | |
for i in range(1, timesToPrint): | |
sys.stdout.write("\tcase: $" + str(i + 2) + "\n") |
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
{ | |
/* Modifier keys: start with C-m */ | |
"^m" = { | |
"^ " = ("insertText:", "\U2423"); /* C-space space */ | |
"^e" = ("insertText:", "\U21A9"); /* C-e return */ | |
"e" = ("insertText:", "\U2305"); /* e enter */ | |
"^t" = ("insertText:", "\U21E5"); /* C-t tab */ | |
"t" = ("insertText:", "\U21E4"); /* t backtab */ |
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
# We have a FunnySentences class. Objects of this class generate five **wacky** phrases with random upper and lower case. | |
# Because the logic of returning the sentences in some modified form is seperate | |
# from the process of generating the sentences, we use a different object to do the generation (single responsiblity princible). | |
# Instead of just using this generation object directly, we assign it to a variable when we create a new FunnySentences object. | |
# Interally, the FunnySentencs object calls methods on this object we pass in, asking it to generate sentences for us. | |
# As long as the generator we pass in returns strings when we call generate on it, | |
# the logic in our FunnySentences class will work no matter what we use for the generator. | |
class FunnySentences |
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
require 'thread' | |
require 'logger' | |
require 'active_support/core_ext/logger' | |
require 'active_support/core_ext/class/attribute_accessors' | |
require 'active_support/deprecation' | |
require 'fileutils' | |
module ActiveSupport | |
# Inspired by the buffered logger idea by Ezra | |
class BufferedLogger |
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
require 'thread' | |
module ActiveSupport | |
# Inspired by the buffered logger idea by Ezra | |
class BufferedLogger | |
module Severity | |
DEBUG = 0 | |
INFO = 1 | |
WARN = 2 | |
ERROR = 3 |
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
<script> | |
Namespace('OurAssets.Sounds', { | |
<%= ['correct1', 'correct2', 'correct3', 'correct4', 'correct5'].map { |s| "#{s}: '#{compute_public_path(s + '.mp3', 'apps/sounds/new')}'" }.join(",\n") %> | |
}); | |
</script> |
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
<dict> | |
<key>name</key> | |
<string>diff.deleted</string> | |
<key>scope</key> | |
<string>markup.deleted.git_gutter</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#F80018</string> | |
</dict> |
OlderNewer