Skip to content

Instantly share code, notes, and snippets.

View galvez's full-sized avatar

Jonas Galvez galvez

View GitHub Profile
@galvez
galvez / index.html
Created December 19, 2020 11:55 — forked from Lodin/index.html
symbol vs string property (http://jsbench.github.io/#c71181ad3112daa34cedb0b24af44e7f) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>symbol vs string property</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
REGIOES_BRASILEIRAS = {
'Norte' => [
['Acre', 'AC'],
['Amapá','AP'],
['Amazonas', 'AM'],
['Pará', 'PA'],
['Rondônia', 'RO'],
['Roraima', 'RR'],
['Tocantins', 'TO']
],
@galvez
galvez / gist:735499
Created December 9, 2010 23:24 — forked from adamv/gist:735176
def print_warning(msg):
print fabric.colors.red("WARNING: ") + msg
def print_error(msg):
print fabric.colors.red("ERROR: ") + msg
def print_label(msg):
print fabric.colors.blue("==> ", bold=True) + msg
@galvez
galvez / gexport.py
Created October 1, 2010 14:54 — forked from mnot/gexport.py
#!/usr/bin/env python
"""\
gexport.py
Export Google Docs to a local directory.
Requires the GData Python client library:
http://code.google.com/p/gdata-python-client/
"""
// jQuery.fn.or
//
// $('.dont-exist').or('.does-exist') //=> [.does-exist];
// $('.does-exist').or('.dont-exist') //=> [.does-exist];
$.fn.extend({
or: function(selector, context) {
if ($(this).length > 0) {
return $(this);
} else {
@galvez
galvez / gist:263457
Created December 25, 2009 01:39 — forked from leandro/gist:263095
#!/bin/bash
# ddiff: Improved diff for directories
# ---------------------------------------------------------------------------------
# This is useful for creating a diff file between two directories.
# It's built upon the tradicional diff program.
# With a difference: it will create diff files for each file present only in the first directory.
# So, for given dirs A and B:
# full-diff A B
#