Skip to content

Instantly share code, notes, and snippets.

View feyeleanor's full-sized avatar

Eleanor McHugh feyeleanor

View GitHub Profile
@FiloSottile
FiloSottile / 32.asm
Last active March 23, 2024 12:28
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@andrewhavens
andrewhavens / sse.rb
Created August 5, 2013 17:25
Working example of SSE using Sinatra and Redis, but with bad concurrency...please help to improve
require 'redis'
require 'sinatra/base'
class SSE < Sinatra::Base
def send_message(json)
"id: #{Time.now}\n" +
"data: #{json}" +
"\r\n\n"
end
@mattetti
mattetti / foo.rb
Last active December 16, 2015 10:59
o_O
module Views
class Rat < SimpleDelegator
begin
include Decorator
rescue NameError => e
end
def initialize(data)
super OpenStruct.new(attributes[data])
end
@temoto
temoto / aes-cfb-example.go
Created February 27, 2013 22:37
Example of AES (Rijndael) CFB encryption in Go. IMHO, http://golang.org/pkg/crypto/cipher/ could benefit a lot from similar snippet.
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func EncryptAESCFB(dst, src, key, iv []byte) error {
aesBlockEncrypter, err := aes.NewCipher([]byte(key))
@jordanorelli
jordanorelli / input.lisp
Created October 14, 2012 03:15
a lisp lexer in Go
(+ 1 (+ 1 1) (dave (sam 1)))
; alright I have comments now!!!!
; woooohooo!!!!
; nice nice nice
(+ 1
22.3
a
;here comes a comment
@greenido
greenido / notes-IndexedDB.html
Created September 23, 2012 09:37 — forked from cfjedimaster/gist:2499973
Simple indexedDB example that will work both in Chrome and FF
<!DOCTYPE html>
<head>
<script>
var db;
// until we won't need this prefix mess
var indexedDB = window.indexedDB || window.webkitIndexedDB
|| window.mozIndexedDB || window.msIndexedDB;
var IDBTransaction = window.IDBTransaction ||
window.webkitIDBTransaction;
@jdiamond
jdiamond / indexeddb.html
Created September 16, 2012 22:25
IndexedDB Example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>IndexedDB Example</title>
</head>
<body>
<h1>IndexedDB Example</h1>
<p>
@allenhwkim
allenhwkim / websocket_client.rb
Created April 18, 2012 21:31
Ruby websocket client
#
# This is modified version of https://github.com/gimite/web-socket-ruby/blob/master/lib/web_socket.rb
#
# Lincense: New BSD Lincense
#
require "base64"
require "socket"
require "uri"
require "digest/md5"
@peterc
peterc / dnsd.rb
Created December 2, 2011 23:47
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL