Skip to content

Instantly share code, notes, and snippets.

set expandtab smarttab
set shiftwidth=2
set tabstop=2
set number ruler
set nowrap backspace=indent,eol,start
set laststatus=2
set linespace=0
set cursorline
set cursorcolumn
var fs = require('fs');
module.exports = {
body : [ 'body.cart' ],
cache: {
eabled: false
},
transform : function(req, response, body, $) {
var partials = req.app.hbsPartials;
var global_data = req.app.bb && req.app.bb.data && req.app.bb.data.partials.length ? req.app.data.partials : {};
if (/categories/.test($('body').data('path')) && $('nav.link-bar h3').length === 1) {
$(window).on('SSReady', function(){
//soysauce.widgets[0].button.click();
//$('nav.link-bar').data('ss-state', 'open');
//$('nav.link-bar .subcategories').data('ss-state', 'open');
//$('nav.link-bar h3').data('ss-state', 'open');
});
}
request.get({url : 'https://lasamobi.com.br/LatLong/json/lojas.json', rejectUnauthorized: false }, function (error, response, body) {
console.log('request');
storeData = JSON.parse(body);
});
import os
import gspread
import json
gpass = os.environ['GPASS']
gc = gspread.login('tommy.wolber@brandingbrand.com', gpass)
sh = gc.open('irobot_FE_Translation_Final')
worksheet = sh.get_worksheet(0)
thekeys = worksheet.col_values(1)
@tomwolber
tomwolber / god.snippet
Created June 7, 2013 05:16
my new favorite @TextExpander snippet for reaching out to coworkers on Skype
Are You There %filltext:name=field 1:default=God%? It's Me, Tommy
import math
# quick test cases
A = [-7, 1, 5, 2, -4, 3, 0]
B = [1, 2, 3, 4, 3, 2, 1]
C = [99, 0, 66, 32, 1]
D = [1, -1, 1, -1, 1, -1, 1]
E = [0,0,0]
F = [0,53,9]
G = [0,1,-1]
@tomwolber
tomwolber / equi.py
Last active December 12, 2015 07:09
A = [-7, 1, 5, 2, -4, 3, 0]
def equi(A):
s = [] # array of equilibrium indices
for a in range(len(A)-1): # loop with '0 index' hack
x = A[:a+1] # split 'left' of the current index
y = A[a+2:] # split 'right' of the current index
n1 = 0 # this will be the total of the 'left' numbers
@tomwolber
tomwolber / sleep.py
Created November 11, 2011 21:38
python sleeeeeeep
import time
import sys
// This sleeps for 10 secs, then prints a bunch of stars
for i in range(10):
time.sleep(1)
print '*',
// Same here
In [16]: for i in range(10):
@tomwolber
tomwolber / euc.py
Created November 11, 2011 19:26
euc.py
a = input("enter first number: ")
b = input("enter second number: ")
while b != 0:
if a > b:
a -= b
else:
b -= a
print a