Skip to content

Instantly share code, notes, and snippets.

@halogenandtoast
halogenandtoast / index.html
Created October 28, 2014 17:21
Includes both examples from the talk. index.html and main.js are the pure WebGL example and three.html is the ThreeJS example.
<!DOCTYPE html>
<html>
<head>
<title>WebGL Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.2.1/gl-matrix-min.js"></script>
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
void main(void) {
module Enumerable
def each_with_emptiness
return to_enum(__callee__) unless block_given?
if empty?
yield nil, true
else
each do |element|
yield element, false
end
@aphyr
aphyr / .conky-prs
Last active August 29, 2015 14:11
Pull request status on desktop via conky
use_xft yes
xftalpha 0.8
text_buffer_size 2048
own_window yes
own_window_argb_visual no
own_window_argb_value 0
own_window_transparent yes
own_window_type override
own_window_hints below,sticky,skip_taskbar,skip_pager
@avdi
avdi / nullenum.rb
Created January 9, 2015 20:32
Behold, the null enumerator.
e = loop
e # => #<Enumerator: main:loop>
e.next # => nil
e.next # => nil
e.peek # => nil
e.size # => Infinity
e.rewind
e.next # => nil
@JEG2
JEG2 / surprise.rb
Created February 19, 2015 15:28
Is this a bug in Ruby or just a poor method definition on my part?
class HashLike
def to_hash
{a: 1, b: 2}
end
end
def surprise(*args, keyword: nil)
p args
end
@mietek
mietek / the-haskell-renaissance.md
Last active August 29, 2015 14:16
Partial transcript of “The Haskell Renaissance”

Giant Robots Smashing into other Giant Robots Podcast

Partial transcript (19:30–21:30)

Pat Brisbin: “We actually shipped some Haskell. We wanted to evaluate shipping an actual production application for ourselves before looking for client work. We decided to add comments to our blog, as sort of a third-party Discus-like system that you can just kind of plug in. So, we call that [Carnival][], and that’s actually open-source. Which has been really great, because when I have a discussion with people about things, I can link them to it, and they can see a real-world example of an actual production web app, written in Haskell. Which is great.”

Ben Orenstein: “And that went pretty well? I remember the development went well, and the deployment was kind of a pain at first?”

require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}
@qrush
qrush / security.md
Last active August 29, 2015 14:24
Package manager service surveys. Additions/corrections welcome.
@echo off
set drive=W:\BACKUP_docs
set musicdrive=W:\BACKUP_music
set backupcmd="C:\backup batches\wndsync.exe" /back /r /auto /showA
set cleancmd="C:\backup batches\dirclean.exe" -r -d -s
echo Started Backup: %date% - %time% >> w:\logs\backup.txt
echo ### Backing up Home Folder...
%cleancmd% -i "%drive%"
l={};s=m=[];i=pc=mc=0
alias p proc
h={'>':p{mc+=1},'<':p{mc-=1},'+':p{m[mc]+=1},'-':p{m[mc]-=1},'.':p{putc m[mc]}}
j={'[':->(i){s<<i;->(){pc=l[pc-1]+1 if m[mc]==0}},']':->(i){o=s.pop;l[o]=i;p{pc=o}}}
ins=DATA.each_char.map{|c|c=:"#{c}";x=(j[c]||->(_){h[c]||p{}}).(i);i+=1;x}
while k=ins[pc];pc+=1;m[mc]||=0;k.();end
__END__
[ This program prints "Hello World!" and a newline to the screen, its
length is 106 active command characters. [It is not the shortest.]