Skip to content

Instantly share code, notes, and snippets.

View josescasanova's full-sized avatar
:octocat:

jose josescasanova

:octocat:
View GitHub Profile
@josescasanova
josescasanova / postgres_queries_and_commands.sql
Created July 7, 2016 16:59 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@josescasanova
josescasanova / setup_selenium.sh
Created March 17, 2016 04:11 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
/*
==============================================
CSS3 ANIMATION CHEAT SHEET
==============================================
Made by Justin Aguilar
www.justinaguilar.com/animations/
Questions, comments, concerns, love letters:
function hello(name, age) {
alert("Hello "+name+", you’re "+age+" years old!");
}
hello("Anon", 42); // "hello Anon, you’re 42 years old!"
hello("Baptiste"); // "hello Baptiste, you’re undefined years old!"
hello("Bulat", 24, 42); // "hello Bulat, you’re 24 years old!
function foo() {
function a() {} // local 'a' is a function
a = 12; // local 'a' is now a number (12)
return a; // return the local 'a' (12)
}
var a = 42;
function foo() {
a = 12;
return a;
function a(){}
}
var a = 2;
function foo() {
var a; // 'a' declaration is moved to top
return a;
a = 5;
}
var a = 2;
function foo() {
return a;
var a = 5;
}
var a = {}, b = {};
a.foo = 42;
b.foo = 18;
a.alertFoo = function() { alert(this.foo); };
a.alertFoo(); // 42
a.alertFoo.call(b); // 18
function setGlobal() {
a = 42;
}
function setLocal() {
var b = 23;
}
setGlobal();
alert(a); // 42
setLocal();
alert(b); // ReferenceError: b is not defined