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
while line = $stdin.gets | |
puts "(" + line.split.map {|i| "'#{i}'"}.join(',') + ")," | |
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
class String | |
def smart_split | |
sa = self.split(/"/).collect { |x| x.strip } | |
return (1..sa.length).zip(sa).collect { |i,x| (i&1).zero? ? x : x.split }.flatten | |
end | |
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
require 'rb-inotify' | |
notifier = INotify::Notifier.new | |
notifier.watch('.', :modify, :recursive) do |event| | |
if event.name.end_with? ".tex" | |
puts "#{`date`.chomp}: Modified #{event.name}; recompiling..." | |
`pdflatex -interaction batchmode -output-directory #{File.dirname(event.absolute_name)} #{event.absolute_name} > /dev/null 2>&1` | |
end | |
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 pyinotify | |
import os | |
import sys | |
class Handler(pyinotify.ProcessEvent): | |
def process_IN_MODIFY(self, event): | |
if event.name.endswith('.tex'): | |
print "Recompiling " + event.name + "..." | |
os.popen('pdflatex ' + event.name).read() |
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
class FooIterator: | |
def __init__(self, underlyingIter): | |
self.underlying = underlyingIter | |
def __iter__(self): | |
return self | |
def next(self): | |
try: | |
return (self.underlying.next(),) |
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
# Tested with Ruby 1.9 | |
# Needs gem "guard" (https://github.com/guard/guard) | |
# Needs gem "guard-shell" (https://github.com/guard/guard-shell) | |
# Uses process "growlnotify" (http://growl.info/extras.php) | |
# Uses process "pdflatex" from standard TeXLive distribution | |
guard 'shell' do | |
watch(%r{(.+)\.tex}) do |m| | |
`growlnotify -m #{m[0]} Recompiling` | |
`pdflatex -interaction=batchmode #{m[0]} >/dev/null` |
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
plugin: | |
default_locale: en | |
locales: [en] | |
# if allow_channels is false, your users will be unable to use any channel | |
# related commands, and as such the default channel will become their permanent | |
# chat place (it is recommended to set default_channel to global if you set this to false) | |
# note: a change to this setting will require a full /reload or server restart | |
allow_channels: true | |
allow_whispers: true | |
allow_afk: true |
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 <stdio.h> | |
int main(int argc, char *argv[]) { | |
printf("Get things done!"); | |
return 0; | |
} |
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 <Foundation/Foundation.h> | |
#import <AppKit/AppKit.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
SEL *selectors = malloc(10 * sizeof(SEL)); | |
// The following selectors are taken from the NSTextAttachmentCell protocol reference. | |
// That document states that NSCell responds to all of its declared methods with three exceptions (noted below). | |
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
on run | |
display dialog "Drag keynote documents on me to convert to PDF." | |
end run | |
on open draggeditems | |
repeat with thisFile in draggeditems as list | |
tell application "Finder" to reveal item thisFile | |
set thisFile to thisFile as alias | |
tell application "Keynote" to open thisFile |
OlderNewer