This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to fetch all repos under a git organization | |
# Returns last committer to master and date of commit | |
# Results sorted by commit date | |
# Replace ORG_NAME, USERNAME, and PASSWORD variables | |
import urllib2 | |
import requests | |
import json | |
ORG_NAME = 'my-org' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
### | |
# | |
# install_mysql.sh | |
# | |
# This script assumes your Vagrantfile has been configured to map the root of | |
# your application to /vagrant and that your web root is the "public" folder | |
# (Laravel standard). Standard and error output is sent to | |
# /vagrant/vm_build.log during provisioning. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'fileutils' | |
errors = [] | |
folderA = 'folder1' | |
folderB = 'folder2' | |
# list all files in each folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
httpProxy = require('http-proxy'); | |
// Create a proxy server with custom application logic | |
var proxy = httpProxy.createProxyServer({}); | |
// | |
// Create your custom server and just call `proxy.web()` to proxy | |
// a web request to the target passed in the options | |
// also you can use `proxy.ws()` to proxy a websockets request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis-cli keys "TripVo*" | cut -d" " -f 2 | xargs redis-cli del |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: http://doublespringlabs.blogspot.com.br/2012/11/decoding-polylines-from-google-maps.html | |
function decode(encoded){ | |
// array that holds the points | |
var points=[ ] | |
var index = 0, len = encoded.length; | |
var lat = 0, lng = 0; | |
while (index < len) { | |
var b, shift = 0, result = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//author: Ismael Stahelin | |
//date: 25.3.2013 | |
//the toggle function | |
//is based on selected option of a select element. if selected option has the desired property with the desired value | |
//so another element, in this case a checkbox element is shown, otherwise it is hidden | |
var toggleTemperature = function(){ | |
var op = $('#tracking_module_tracking_module_model_id option:selected'); | |
if($(op).attr('data-has_temperature_sensor') == 'true'){ | |
$('#temperature_control').show("fast"); | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filtering row on a table | |
_searchItems: () => | |
criteria = $("#searchItems").val() | |
$("#schedules_table tbody tr").css('display', 'table-row') | |
$("#schedules_table tbody tr").not(":contains('#{criteria}')").each () -> | |
$(this).css('display', 'none') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extracted from http://fernandomantoan.com/javascript/serie-backbone-js-parte-3-model/ | |
require 'sinatra' | |
require 'json' | |
require 'active_record' | |
# O JSON não deve conter um elemento ROOT, apenas os atributos | |
ActiveRecord::Base.include_root_in_json = false | |
class Post < ActiveRecord::Base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for x in `gem list --no-versions`; do gem uninstall $x; done |
NewerOlder