Skip to content

Instantly share code, notes, and snippets.

View jorinvo's full-sized avatar

Jorin jorinvo

View GitHub Profile
@jorinvo
jorinvo / bookmarkableTabs.html
Created January 26, 2012 12:15
A little Example demonstrating how to implement bookmarkable tabs
<!DOCTYPE html public>
<head>
<meta charset=utf-8>
<title>Bookmarkable Tabs Demo</title>
<style>
@jorinvo
jorinvo / upload.js
Created August 7, 2012 09:00
jQuery html5 uploader
(function ($) {
$.fn.html5Uploader = function (options) {
var crlf = '\r\n';
var boundary = "iloveigloo";
var dashes = "--";
var settings = {
"name": "uploadedFile",
@jorinvo
jorinvo / mousewheel.js
Created August 7, 2012 09:02
Track mouse wheel events
document.addEventListener('mousewheel', function(e) {
handleWheel(e);
}, false);
document.addEventListener('DOMMouseScroll', function(e) {
.handleWheel(e);
}, false);
var handleWheel = function(e) {
@jorinvo
jorinvo / gridBookmarklet.js
Created August 20, 2012 22:29
useful bookmarklet to toggle a 10px grid overlay on your page for design purposes
(function(window, doc, undefined) {
var awesomeGridBookmarkletElement = doc.getElementById('awesomeGridBookmarkletElement');
if ( awesomeGridBookmarkletElement !== null) {
awesomeGridBookmarkletElement.parentNode.removeChild(awesomeGridBookmarkletElement);
return;
}
var grid = doc.createElement('div');
grid.id = 'awesomeGridBookmarkletElement';
grid.style.backgroundImage = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3AgUFTcrYHXFEgAAAAxpVFh0Q29tbWVudAAAAAAAvK6ymQAAABlJREFUGNNjZGBg+M9AJCBKIROxpo0qxAsADuYCECT/rwcAAAAASUVORK5CYII=)';
grid.style.position = 'fixed';
@jorinvo
jorinvo / gist:4275139
Created December 13, 2012 09:06
Generate file from YAML data with mustache layout.
#!/usr/bin/ruby
require 'mustache'
require 'yaml'
LAYOUT = 'layout.html'
DATA = 'data.yaml'
OUT = 'index.html'
@jorinvo
jorinvo / fizzbuzz.js
Created June 2, 2013 00:06
Try to write FizzBuzz with as little code as possible. Language doesn't matter. This one in javascript is 66 chars.
for(n=0;++n<101;){console.log((n%3?'':'Fizz')+(n%5?'':'Buzz')||n)}
@jorinvo
jorinvo / un-bot.md
Last active December 18, 2015 00:08
commands for un-bot
  • un-bot image me query - The Original. Queries Google Images for query and returns a random top result.

  • un-bot animate me query - The same thing as image me, except adds a few parameters to try to return an animated GIF instead.

  • un-bot mustache me url - Adds a mustache to the specified URL.

  • un-bot mustache me query - Searches Google Images for the specified query and mustaches it.

  • un-bot map me query - Returns a map view of the area returned by query.

  • un-bot math me expression - Calculate the given expression.

  • un-bot convert me expression to units - Convert expression to given units.

@jorinvo
jorinvo / commands.md
Last active December 18, 2015 00:09
Scripts um Hubot auf Uberspace zu installieren.Für mehr Infos: http://jorinvogel.wordpress.com/2013/06/02/hubot-auf-uberspace-installieren/
  • hubot image me query - The Original. Queries Google Images for query and returns a random top result.

  • hubot animate me query - The same thing as image me, except adds a few parameters to try to return an animated GIF instead.

  • hubot mustache me url - Adds a mustache to the specified URL.

  • hubot mustache me query - Searches Google Images for the specified query and mustaches it.

  • hubot map me query - Returns a map view of the area returned by query.

  • hubot math me expression - Calculate the given expression.

  • hubot convert me expression to units - Convert expression to given units.

@jorinvo
jorinvo / protectMail.html
Last active December 18, 2015 03:48
protectMail - a simple jQuery plugin to protect emails from spam bots using data-attributes.
<head>
<title>protectMail Examples</title>
<script src="http://code.jquery.com/jquery-2.0.2.min.js"></script>
<script src="protectMail.js"></script>
</head>
<body>
<h1>protectMail Examples</h1>
<p>
@jorinvo
jorinvo / getFunky.coffee
Created July 2, 2013 23:33
some experimentation with functional programming. partial application and composition is awesome! after writing it in js I felt like rewriting in coffescript. its really nice to get rid of all the `function` and `return` keywords. And [splats](http://coffeescript.org/#splats) are damn useful when you work with the arguments object.
_ =
pop: (ctx) ->
Array::pop.call ctx
slice: (args..., ctx) ->
Array::slice.apply ctx, args
reduce: (args..., ctx) ->
Array::reduce.apply ctx, args