Skip to content

Instantly share code, notes, and snippets.

Avatar

Ernesto Méndez mendezcode

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am mendezcode on github.
  • I am mendezcode (https://keybase.io/mendezcode) on keybase.
  • I have a public key ASCvmN7SBl3aJ7G3ARKkhPESI24fk19n458kDky8TnTXygo

To claim this, I am signing this object:

@mendezcode
mendezcode / trim-whitespace.hs
Last active Aug 29, 2015
Small haskell program to trim whitespace in files
View trim-whitespace.hs
import System.Environment (getArgs)
import System.Directory (doesFileExist)
import Data.Char (isSpace)
main :: IO ()
main = do
args <- getArgs
case args of
[] -> putStrLn msg
[_] -> putStrLn msg
View sed.js
var fs = require('fs');
var util = require('util');
function main() {
var args = process.argv.slice(2);
if (args.length === 3) {
var regex = eval(args[0]);
@mendezcode
mendezcode / twitter-utils.js
Last active Aug 29, 2015
twitter-utils.js
View twitter-utils.js
// twitter-util.js (c) 2014 Ernesto Méndez
// @version 1.0.0 / Fri, 30 May 2014 03:40:18 GMT
// MIT license: http://opensource.org/licenses/MIT
// twitterlib.js (c) 2011 Remy Sharp
// @version 1.0.9 / Sun, 19 Feb 2012 23:05:25 GMT
// MIT license: http://rem.mit-license.org
(function () {
@mendezcode
mendezcode / image-data-uri.js
Created Apr 8, 2014
Get image data URI bookmarklet
View image-data-uri.js
(function() {
var img = document.querySelectorAll('img')[0];
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
var pre = document.createElement('pre');
pre.style.padding = "1em";
pre.style.wordWrap = 'break-word';
pre.style.color = "#323232";
pre.innerHTML = canvas.toDataURL('image/png')
@mendezcode
mendezcode / locales.json
Created Jan 5, 2014
Locales in JSON format
View locales.json
{
"af": "Afrikaans",
"sq": "Albanian",
"am": "Amharic",
"ar_DZ": "Arabic - Algeria",
"ar_BH": "Arabic - Bahrain",
"ar_EG": "Arabic - Egypt",
"ar_IQ": "Arabic - Iraq",
"ar_JO": "Arabic - Jordan",
"ar_KW": "Arabic - Kuwait",