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
| module Env | |
| MACRUBY_FRAMEWORK_BIN = 'MacRuby.framework/Versions/Current/usr/bin/macruby' | |
| MACRUBY_CANDIDATES = [ | |
| "/System/Library/PrivateFrameworks/#{MACRUBY_FRAMEWORK_BIN}", | |
| "/Library/Frameworks/#{MACRUBY_FRAMEWORK_BIN}" | |
| ] | |
| def self.find_macruby | |
| MACRUBY_CANDIDATES.each do |path| | |
| return path if File.exist?(path) |
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
| #!/bin/sh | |
| # Run this script with sudo | |
| launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist | |
| cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.cse | |
| cat >> /etc/cups/cupsd.conf <<EOF | |
| # Show shared printers on the UW CSE network. | |
| BrowseRemoteProtocols cups |
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
| framework 'cocoa' | |
| class HelloFS | |
| PATH = '/hello.txt' | |
| def contentsOfDirectoryAtPath(path, error: error) | |
| [PATH.lastPathComponent] | |
| end | |
| def contentsAtPath(path) |
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
| let self = require('self'), file = require('file'), url = require('url'); | |
| let contextMenu = require('context-menu'); | |
| let sym = gensym(), containerID = 'word-cloud-' + sym; | |
| let item = contextMenu.Item({ | |
| label: "Show Word Cloud", | |
| onClick: function(context, item) { | |
| let win = context.window, corpus = generateCorpus(win); | |
| let scores = score(corpus), sorted = plist(scores); | |
| sorted.sort(byScore); |
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
| // https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Media_events | |
| // https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMHTMLMediaElement | |
| var Sounds = { | |
| sounds: {}, | |
| errors: [null, "ABORTED", "NETWORK", "DECODE", "SRC_NOT_SUPPORTED"], | |
| register: function register(sounds) { | |
| var errors = this.errors; | |
| for (var i = 0, l = sounds.length; i < l; i++) { |
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
| Number.prototype.upto = function upto(end) { | |
| var start = this; | |
| function NumberIterator() { | |
| this.current = start; | |
| } | |
| NumberIterator.prototype.next = function next() { | |
| if (this.current > end) { | |
| throw StopIteration; | |
| } else { | |
| return this.current++; |
NewerOlder