Skip to content

Instantly share code, notes, and snippets.

View coto's full-sized avatar
🏠
Working from home

Rodrigo Augosto coto

🏠
Working from home
  • Earth Planet, Milky Way
View GitHub Profile
@coto
coto / isObjectLiteral.html
Created July 23, 2009 22:41 — forked from jeresig/isObjectLiteral.html
Identify if an object (JavaScript) is Literal or not
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<!-- Online here: http://ejohn.org/files/bugs/isObjectLiteral/ -->
<title>isObjectLiteral</title>
<style>
li { background: green; } li.FAIL { background: red; }
iframe { display: none; }
</style>
@coto
coto / RSA.sh
Created October 29, 2010 03:10
Create & Upload a RSA Key for Github and others
mkdir -p ~/.ssh
ssh-keygen -t rsa -C "your_email@youremail.com"
scp -P $port ~/.ssh/id_rsa.pub $user@$ip:/$folder/
echo "==================================================================="
echo "============= Local Key ==============="
echo "==================================================================="
cat ~/.ssh/id_rsa.pub
echo "==================================================================="
echo "============= Remote ==============="
echo "==================================================================="
@coto
coto / benchmark-javascript.html
Last active January 5, 2016 21:43
JavaScript Benchmark - Closure vs Prototype
<html>
<head>
<title>Becnhmark - Javascript prototype versus closure execution speed</title>
<script type="text/javascript">
/*
* Author: Coto Augosto
* Twitter: http://twitter.com/coto
* URL: http://beecoss.com
* Created: Nov 30, 2010
*/
@coto
coto / Objects with JavaScript.js
Last active January 5, 2016 21:33
Classes/Objects in JavaScript: Different ways to define them
/***********************************
Author: Rodrigo Augosto C.
Twitter: http://twitter.com/coto
Date: Dec 17, 2010
************************************/
// ###### Example 1: Object Using new Object() ######
person = new Object();
person.name = "Brendan Eich";
person.height = "6Ft";
@coto
coto / system_tips.sh
Last active September 29, 2015 10:08
System Tips
# Listen which port an interface is using (wlan0, eth0, etc)
tcpdump -nettti wlan0
# List logs on real time
tail -f /var/log/*
# DNS Lookup (Query NS Records)
dig ns domain.com @8.8.8.8
# Query MX Records
@coto
coto / gist:4073869
Last active October 12, 2015 19:08
Rename commiters
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "OLD_EMAIL" ];
then
GIT_COMMITTER_EMAIL="NEW_EMAIL";
GIT_AUTHOR_EMAIL="NEW_EMAIL";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
"""
Use with:
python twitter_friends.py > twitter_friends.csv
JSON Tools:
http://www.jsoneditoronline.org/
http://jsonparser.com/
"""
import urllib2
@coto
coto / bash.sh
Last active August 29, 2015 14:27
# Find all the .c files in each linux directory:
find . -print | grep -e '\.c$' > ../srcfiles-0.95.txt
# Find the common lines:
comm -1 -2 srcfiles-0.95.txt srcfiles-4.1.4.txt >srcfiles-common.txt
<html>
<head>
<style>
div {
position: relative;
min-height: 300px;
background-color: #9CCF31;
}
p {
bottom: 0;
/*
interface Obj {
get() => Any;
}
o(secret: Any) => Obj
*/
const o = (secret) => {
return {
get: () => secret
};