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
const response = require('cfn-response'); | |
const http = require('https'); | |
const url = require('url'); | |
exports.handler = function(event, context) { | |
var props = event.ResourceProperties; | |
var options = { | |
hostname: 'api.github.com', | |
headers: { | |
'Accept': 'application/vnd.github.v3+json', | |
'Authorization': `token ${props.GitHubToken}`, |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<array> | |
<dict> | |
<key>on</key> | |
<integer>1</integer> | |
<key>replace</key> | |
<string>:smile:</string> | |
<key>with</key> |
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
void setup() { | |
size(1080, 1080); | |
noStroke(); | |
background(0, 0, 255); | |
int rows = int(pow(2, int(random(1,6)))); | |
int u = height / (rows + 4); | |
int thickness = int(pow(2, int(random(1, 4)))); | |
int uth1 = u / thickness; | |
int uth2 = u + uth1; | |
int startX = int(-u * 0.75); |
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
gem 'rumoji', :git => "git://github.com/mwunsch/rumoji.git", :tag => "v0.2.0" | |
gem 'osxsub', :git => "git://github.com/mwunsch/osxsub.git", :tag => "v0.1.2" |
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
fibRecurse := method(n, | |
if(n == 0, 0, | |
if(n == 1, 1, | |
fibRecurse(n-1) + fibRecurse(n - 2) | |
) | |
) | |
) | |
fibLoop := method(n, | |
i := 0 ; a := 0 ; b := 1 |
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 'sinatra' | |
get '/' do | |
erb :index | |
end | |
get '/events' do | |
f = File.new("pipe") | |
content_type 'text/event-stream' |
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
def fibonacci(n) | |
Enumerator.new do |yielder| | |
i = j = 1 | |
loop do | |
yielder << i | |
i, j = j, i+j | |
end | |
end.take(n) | |
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
def sieve(n) | |
integers = 2..n | |
not_primes = (2..Math.sqrt(n).ceil).reduce([]) do |marked, p| | |
(p**2).step(n, p) {|j| marked << j } | |
marked | |
end | |
integers.to_a - not_primes | |
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
t timeline -l | ruby -e 'puts $stdin.readlines.shuffle.pop' | awk '{ print $1}' | xargs -J % t reply % 'NOW you'"'"'re talking my language! (cf. https://twitter.com/markwunsch/status/382969649509707776)' |
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 'formula' | |
class Osxsub < Formula | |
homepage 'https://github.com/mwunsch/osxsub' | |
url 'https://github.com/mwunsch/osxsub/tarball/v0.1.2' | |
sha1 '93c766bfde5aa27c186018d4450c0c41ddae6ffa' | |
head 'https://github.com/mwunsch/osxsub.git' | |
def install | |
bin.install 'bin/osxsub' |