An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
<?php | |
namespace CHH; | |
trait MetaObject | |
{ | |
protected static $__metaClass; | |
static function setMetaClass(MetaClass $metaClass) | |
{ |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
browser = request.user_agent.browser | |
version = request.user_agent.version and int(request.user_agent.version.split('.')[0]) | |
platform = request.user_agent.platform | |
uas = request.user_agent.string | |
if browser and version: | |
if (browser == 'msie' and version < 9) \ | |
or (browser == 'firefox' and version < 4) \ | |
or (platform == 'android' and browser == 'safari' and version < 534) \ | |
or (platform == 'iphone' and browser == 'safari' and version < 7000) \ |
//This is the Backbone controller that manages the content of the app | |
var Content = Backbone.View.extend({ | |
initialize:function(options){ | |
Backbone.history.on('route',function(source, path){ | |
this.render(path); | |
}, this); | |
}, | |
//This object defines the content for each of the routes in the application | |
content:{ | |
"":_.template(document.getElementById("root").innerHTML), |
Put test1.js
and test2.js
into a tests/
directory, then run the suite:
$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
//phantomjs | |
var page = require('webpage').create(); | |
var url = 'http://instagram.com/'; | |
page.open(url, function (status) { | |
var js = page.evaluate(function () { | |
return document; | |
}); | |
console.log(js.all[0].outerHTML); | |
phantom.exit(); |
# SELENIUM_SERVER is the IP address or hostname of the system running Selenium | |
# Server, this is used to determine where to connect to when using one of the | |
# selenium_remote_* drivers | |
SELENIUM_SERVER = "10.10.11.1" | |
# SELENIUM_APP_HOST is the IP address or hostname of this system (where the | |
# tests run against) as reachable for the SELENIUM_SERVER. This is used to set | |
# the Capybara.app_host when using one of the selenium_remote_* drivers | |
SELENIUM_APP_HOST = "10.10.11.2" |
DROP TABLE IF EXISTS time_dimension; | |
CREATE TABLE time_dimension ( | |
id INTEGER PRIMARY KEY, -- year*10000+month*100+day | |
db_date DATE NOT NULL, | |
year INTEGER NOT NULL, | |
month INTEGER NOT NULL, -- 1 to 12 | |
day INTEGER NOT NULL, -- 1 to 31 | |
quarter INTEGER NOT NULL, -- 1 to 4 | |
week INTEGER NOT NULL, -- 1 to 52/53 | |
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'... |