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 / 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
require File.join(File.dirname(__FILE__), 'abstract-php-extension')
class Php54Mongo < AbstractPhp54Extension
init
homepage 'http://pecl.php.net/package/mongo'
url 'http://pecl.php.net/get/mongo-1.4.4.tgz'
sha1 '9cc3b308c6dccb4bbf376fce4bcc2268aa7a7c1d'
head 'https://github.com/mongodb/mongo-php-driver.git'
def install
requirejs.config({
// Set burst to prevent any kind of cache
urlArgs : "bust=" + (new Date()).getTime(),
waitSeconds : 0,
paths: {
//CORE INCLUDES
jquery : 'public/plugins/jquery/jquery.min',
backbone : 'public/plugins/backbone/backbone',
marionette : 'public/plugins/backbone/backbone.marionette',
var App = {};
App.Templates = {};
App.Templates.templates = {};
App.Templates.changelog = {};
App.Templates.configs = {};
App.Templates.templates.create = '<div id=rootwizard><ul id=nav-tab><li><a href=#template-selector data-toggle=tab><i class=img-circle>1</i><div data-i18n=templates:insert.template></div></a></li><li><a href=#campaign-editor data-toggle=tab><i class=img-circle>2</i><div data-i18n=templates:insert.design></div></a></li><li><a href=#tab1 data-toggle=tab><i class=img-circle>3</i><div data-i18n=templates:insert.info.tab></div></a></li></ul><div class=tab-content><div class=tab-pane id=template-selector></div><div class=tab-pane id=campaign-editor></div><div class=tab-pane id=tab1><h3 data-i18n=templates:insert.info.title></h3><p data-i18n=templates:insert.info.description></p><form id=form1 class=form-horizontal><div class=row><div class="col-lg-6 col-sm-10 col-sm-6"><div class=form-group><label for=name class="col-sm-4 control-label" data-i18n=templates:insert.info.template></label><div clas
// My region controller, it's located where the application it's booted
App.mainRegion.on("show", function( view ){
window.onViewRendered( view );
});
// The function which it's been called - The rendered view was passed by the regionManager
window.onViewRendered = function (renderedView){
@wallynm
wallynm / baseRouter.js
Created March 24, 2015 16:41
The base router start the History management for the url controlling, when user access template/ it access method invokeTemplate, as i'm using requireJS to take care of dependencies of my project i load the needed subrouter and when my subrouter get's loaded it's take care of the new routes.
mainRouter = Backbone.Router.extend({
routes : {
"templates/*subroute" : "invokeTemplates",
},
invokeTemplates: function()
{
console.log('>>>>> invokeTemplates');
require(['templateRouter'], function () {
App.Routers.Templates = new App.Routers.Templates("templates/");
Backbone.Marionette.TabControl = Marionette.LayoutView.extend({
template : function() { return $('<ul class="nav nav-tabs"></ul><div class="tab-content"></div>'); },
tagName : 'div',
className : 'tabbed-content',
liView : '<li><a href="#<%= tabid %>" role="tab" data-toggle="tab" data-i18n="<%= tabtitle %>"></a></li>',
tabView : '<div role="tabpanel" class="tab-pane" id="<%= tabid %>"></div>',
tabs : [],
data : {},
defaultTab : 0,
@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 / base.js
Last active September 7, 2016 01:18
function deepPlain(array, parentKey, controlArray){
controlArray = _.isUndefined(controlArray) ? [] : controlArray;
_.each(array, function(item, key){
if(_.isObject(item)){
if(!_.isString(key))
key = undefined;
@wallynm
wallynm / 0-tiendanube-payment-sdk.md
Last active November 5, 2018 10:58
Payment Integration

Instructions about how integrate all external methods

To generate and get the gist files updated:

var scripts = {}
document.querySelectorAll('.file-header .btn.btn-sm ').forEach(item => {
	const script = item.href.replace('gist.github', 'rawgit')
	const data = script.split('/')