Skip to content

Instantly share code, notes, and snippets.

View Fonsan's full-sized avatar

Erik Fonselius Fonsan

View GitHub Profile
@Fonsan
Fonsan / keybase.md
Created March 8, 2014 14:46
keybase.md

Keybase proof

I hereby claim:

  • I am Fonsan on github.
  • I am Fonsan (https://keybase.io/Fonsan) on keybase.
  • I have a public key whose fingerprint is CA01 210C 0B82 03F4 D398 E46A B39E DC79 D3A5 A0CF

To claim this, I am signing this object:

@Fonsan
Fonsan / index.erb
Created December 20, 2013 15:52
webscope
<html>
<head>
<meta http-equiv="refresh" content="3" >
<title>LOL</title>
</head>
<body>
<img style="width:100%;height:100%" src="data:image/gif;base64,<%= @image %>">
</body>
</html>
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package relation;
/**
*
* @author fonsan
*/
jQuery('.song-name a').each(function() {
var e = $(this)
var frame = $('<iframe/>')
frame.attr('src', e.attr('href'));
frame.attr('height', '200px')
frame.attr('width', '500px')
e.parent().parent().after(frame);
var w = frame.first()[0].contentWindow;
w.addEventListener('load', function() {
w.scroll(0,300)
@Fonsan
Fonsan / Sample output
Created November 30, 2012 11:40
Keepalive tester MIT license
$ sh keepalive.sh
Normal get
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 30 Nov 2012 11:38:26 GMT
Content-Type: text/plain
Content-Length: 2
Connection: keep-alive
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package hello;
import javax.swing.JFrame;
import javax.swing.JLabel;
/**
@Fonsan
Fonsan / window.js
Created May 25, 2012 13:39
Mock window
var createWindow = function() {
var events = kafkaFactory();
var register = function(wantedObj, wantedType, callback) {
events.register(function(obj, type, event) {
if (wantedObj === obj && wantedType === type) {
callback(event);
}
});
};
var evented = function() {
@Fonsan
Fonsan / blocks.rb
Created May 9, 2012 18:24
First class citizen methods in ruby
def do_something
yield 'something'
end
do_something do |thing|
puts thing
end
def do_complex(first, second)
thing = 'nothing'
@Fonsan
Fonsan / eye.html
Created October 12, 2011 12:37
Eyetracking
<div id="sas">
<embed src="http://rich-ads.s3.amazonaws.com/a27f1e29edc38a7be523ad69b6b73258.swf" name="FlashID1x" quality="autohigh" wmode="opaque" swliveconnect="true" width="1010" height="120" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" title="Flash">
</div>
module I18n
class << self
def translate(*args)
args.inspect
end
def localize(*args)
args.inspect
end
alias_method :l, :localize