Skip to content

Instantly share code, notes, and snippets.

View mikaa123's full-sized avatar

Michael Sokol mikaa123

  • Paris, France
View GitHub Profile
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@eethann
eethann / _.objMapFunctions.js
Created August 23, 2012 01:05
Underscore mixin with common iterator functions adapted to work with objects and maintain key/val pairs.
_.mixin({
// ### _.objMap
// _.map for objects, keeps key/value associations
objMap: function (input, mapper, context) {
return _.reduce(input, function (obj, v, k) {
obj[k] = mapper.call(context, v, k, input);
return obj;
}, {}, context);
},
// ### _.objFilter

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@macournoyer
macournoyer / app.ru
Created August 19, 2011 17:02
The invisible block web framework. In honor of _why.
# rackup app.ru
require "./invisible"
app = Invisible.new do
get "/" do
render do
h1 "Why?"
p "Because."
end
@rjrodger
rjrodger / draw.html
Created June 6, 2011 20:32
Little HTML5 mobile web app for drawing on a canvas
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no,initial-scale=1.0,maximum-scale=1.0" />
<style>
body { padding:10px; margin:0px; background-color: #ccc; }
#main { margin: 10px auto 0px auto; }
</style>
@zzak
zzak / gist:830035
Created February 16, 2011 19:49
define_method hello, world!
def add_method(obj, mod, &blk)
obj.class_eval { define_method(mod, &blk) }
end
add_method(String, :greet) { "Hello, #{self}" }
"world".greet #=> "Hello, world!"