Skip to content

Instantly share code, notes, and snippets.

View julsdelatierra's full-sized avatar

Jul Ceballos julsdelatierra

View GitHub Profile
{
"shipment": {
"id": "12345",
"carrier_rate": 1000,
"shipper_price": 900,
"origin": "Monterrey, NL",
"destination": "Cuauhtémoc, CDMX",
"pickup_datetime": "2019-10-29 22:00:00-05:00",
"delivery_datetime": "2019-10-13 13:00:00-05:00",
"shipment_type": 1
function sleep(milliseconds) {
var start = new Date().getTime()
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds) {
break
}
}
}
for(var i = 0; i < $('.mdtc-clnplra-playlist-item').length; i++) {

1. SQL

CREATE DATABASE family;
USE family;
CREATE TABLE rels (padre INT, hijo INT);
INSERT INTO rels (padre, hijo) VALUES (20, 18);
INSERT INTO rels (padre, hijo) VALUES (12, 6);
INSERT INTO rels (padre, hijo) VALUES (18, 4);
INSERT INTO rels (padre, hijo) VALUES (34, 20);
@julsdelatierra
julsdelatierra / bitbucket policy
Created April 28, 2014 18:02
bitbucket policy
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@julsdelatierra
julsdelatierra / css3ResizeEffect.css
Created March 19, 2012 05:25
Input resize animation with css3
input{
width:300px;
-moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;
transitition-duration:1s;
}
input:hover{
width:500px;
}
#!/usr/bin/env python
REQUIRES_MAIN_JS ='''var %(module)s = require('%(module)s');
'''
MAIN_JS = '''
exports.main = function(options, callbacks){
console.log('Jetpack addon running');
/*Your code is here below*/
import os, sys
from pyExcelerator import *
os.system('ls -R * > lista.txt')
lista=open('lista.txt','r')
path=''
cad=''
cadena=''
cont_row=0
libro=Workbook()
hoja=libro.add_sheet('data')
def makepackage(env_root, args):
pack_path=os.path.abspath(os.path.dirname('__file__'))
from templates import DEFAULT_README_DOC, MAIN_JS, MAIN_JS_DOC, MODULE_JS, PACKAGE_TEMPLATE, REQUIRES_MAIN_JS
if len(args)%2 == 0:
try:
requires = ''
for d in ['','lib','data','tests','docs']:
os.mkdir(os.path.join(pack_path,args[1],d))
file = open(os.path.join(pack_path,args[1],'README.md'),'w')
file.write(DEFAULT_README_DOC % {'packName':args[1]})
CmdUtils.CreateCommand({
names: ["goto"],
icon: "http://www.mozilla.org/favicon.ico",
description: "Command to go to a website.",
help: "Just write goto and your url.",
author: {name: "Julian Ceballos", email: "julianceballos@mozilla-mexico.org"},
license: "GPL",
homepage: "http://mozilla-mexico.org",
arguments: [{role: 'object', nountype: noun_arb_text}],
preview: function preview(pblock, args) {
@julsdelatierra
julsdelatierra / mozmx.js
Created June 15, 2010 02:56
Ubiquity command to browse on Mozilla México website
CmdUtils.CreateCommand({
names: ["mozmx"],
icon: "http://www.mozilla-mexico.org/favicon.ico",
description: "Comando para navegar en el sitio de mozilla México",
help: "Escribe mozmx y alguna de las opciones: wiki,forums,groups,chat,blog",
author: {name: "Julian Ceballos", email: "julianceballos@mozilla-mexico.org"},
license: "GPL",
homepage: "http://www.mozilla-mexico.org",
arguments: [{role: 'object', nountype: noun_arb_text}],
preview: function preview(pblock, args) {