Skip to content

Instantly share code, notes, and snippets.

View wallynm's full-sized avatar
🎯
Focusing

Wallysson mota wallynm

🎯
Focusing
View GitHub Profile
@wallynm
wallynm / gist:169216c5424f23d9aa82
Created October 7, 2015 00:35
Storage - localStorage wrapper for enyo 2
enyo.kind({
name: "Storage",
kind: "Component",
statics: {
/* Set the value of item[key] to the stringified version of obj. */
set: function(name, obj){
localStorage.setItem(name, JSON.stringify(obj));
},
@wallynm
wallynm / gfm.rb
Created November 29, 2011 15:45 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end