Skip to content

Instantly share code, notes, and snippets.

View marcoslhc's full-sized avatar
🏳️‍🌈
He's like the rainbow

Marcos Hernández marcoslhc

🏳️‍🌈
He's like the rainbow
View GitHub Profile
@marcoslhc
marcoslhc / dabblet.css
Created April 15, 2014 15:07
Pure CSS indicator
/*
Pure CSS indicator
*/
.counter {
display:table;
width:52px;
height:48px;
position:relative;
border-radius:3px;
}
@marcoslhc
marcoslhc / gist:ed727dbe8746ee57953a
Created May 10, 2014 13:37
Git merge "dry-run"
git format-patch $(git merge-base branch1 branch2)..branch2 --stdout | git apply --check -
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
### Keybase proof
I hereby claim:
* I am marcoslhc on github.
* I am marcoslhc (https://keybase.io/marcoslhc) on keybase.
* I have a public key whose fingerprint is 34BD BD4F 08FC 5940 AF31 6585 5291 C895 5E11 CF55
To claim this, I am signing this object:
@marcoslhc
marcoslhc / dabblet.css
Created July 1, 2014 14:06
Box with arrow
/**
* Box with arrow
*/
.search-window {
border-radius: 0.5em;
background-image: linear-gradient(to bottom, rgb(228,220,210) 30%, rgb(220, 200,190) 70%,rgb(200,190,170));
padding: 0.5em 20px;
width:33%;
height:100px;
@marcoslhc
marcoslhc / README.md
Created August 9, 2014 17:52
Simple tornado websocket server (simplest, unsecure, just-for-show case)

This is an updated version from the one published here

'''sh mkvirtualenv test_websocket pip install tornado '''

@marcoslhc
marcoslhc / gist:810c1b53e26478ce399d
Last active August 29, 2015 14:07
very simple template system
/**
* Based in underscore.js
* and the Crockford's supplant method
**/
function makeTemplate(tmpl) {
var interpolation = /\{\{([^{}]*)\}\}/g;
return function (obj) {
return tmpl.replace(interpolation,
@marcoslhc
marcoslhc / appify
Last active August 29, 2015 14:07 — forked from mathiasbynens/appify
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
// Here’s a 100% deterministic alternative to `Math.random`. Google’s V8 and
// Octane benchmark suites use this to ensure predictable results.
Math.random = (function() {
var seed = 0x2F6E2B1;
return function() {
// Robert Jenkins’ 32 bit integer hash function
seed = ((seed + 0x7ED55D16) + (seed << 12)) & 0xFFFFFFFF;
seed = ((seed ^ 0xC761C23C) ^ (seed >>> 19)) & 0xFFFFFFFF;
seed = ((seed + 0x165667B1) + (seed << 5)) & 0xFFFFFFFF;
@marcoslhc
marcoslhc / Assert.coffee
Last active August 29, 2015 14:12
Assert
assert = (condition, message) ->
if !condition
message = message || "Assertion Failed"
if typeof Error != 'undefined'
throw new Error(message)
throw message