An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
<?php | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return array |
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# | |
# URLs to read: | |
# |
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
<?php | |
// cURL obeys the RFCs as it should. Meaning that for a HTTP/1.1 backend if the POST size is above 1024 bytes | |
// cURL sends a 'Expect: 100-continue' header. The server acknowledges and sends back the '100' status code. | |
// cuRL then sends the request body. This is proper behaviour. Nginx supports this header. | |
// This allows to work around servers that do not support that header. | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); | |
// We're emptying the 'Expect' header, saying to the server: please accept the body right now. | |
// Read here: http://pilif.github.com/2007/02/the-return-of-except-100-continue/ |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
var casper = require('casper').create(); | |
var webpage = "http://wordpress.org/"; | |
casper.on('resource.requested', function(resource) { | |
for (var obj in resource.headers) { | |
var name = resource.headers[obj].name; | |
var value = resource.headers[obj].value; | |
if (name == "User-Agent"){ |
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375"," |