This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$urls = ['www.amazon.com',...]; | |
foreach ($url as $ip => $url) { | |
// create a stream that returns immediately | |
// STREAM_CLIENT_CONNECT _MUST_ be passed | |
// STREAM_CLIENT_ASYNC_CONNECT says create connection | |
// asyncrhronously | |
$socket = stream_socket_client("tcp://$ip:80", $errno, $errstr, 0, | |
STREAM_CLIENT_CONNECT, STREAM_CLIENT_ASYNC_CONNECT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
today = log --since=midnight --author='Davide Cavaliere' --oneline | |
history = log --graph --pretty=format:'%Cred%h%Creset %d -%Cblue %s%Creset %Cgreen(%ar) %Cblue<%an>%Creset' --abbrev-commit --date=relative | |
ci = commit | |
st = status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import json | |
import sys | |
j = json.load(sys.stdin) | |
print json.dumps(j, sort_keys=True, indent=2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} }, | |
{ "keys": ["alt+up"], "command": "swap_line_up" }, | |
{ "keys": ["alt+down"], "command": "swap_line_down" }, | |
{ "keys": ["ctrl+alt+j"], "command": "join_lines" }, | |
{ "keys": ["ctrl+alt+down"], "command": "duplicate_line" }, | |
{ "keys": ["shift+ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, | |
{ "keys": ["ctrl+shift+s"], "command": "save_all" }, | |
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
{ "keys": ["shift+ctrl+f4"], "command": "close_all" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in *.jpg; do convert $i -resize 50% $(basename $i .jpg).jpg; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 4; | |
daemon off; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directive('ngThumbnail', function($timeout){ | |
return { | |
replace : true, | |
restrict : 'E', | |
templateUrl : 'js/templates/ngThumbnail.html', | |
//transclude : true, | |
scope : { | |
targetHref : '=', | |
imageSrc : '@', | |
id : '@', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = true; | |
var log = { | |
debug : function(string) { | |
if (debug) { | |
console.info(string); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ** wij-combobox directive | |
// - Input element with auto-complete (shows list as the user types) | |
// - Implemented using the Wijmo wijcombobox widget. | |
// ** example | |
// <wij-combobox | |
// value="trip.from" | |
// source="comboItems" > | |
// </wij-combobox> | |
// ** see | |
// - Wijmo wijcombobox: http://wijmo.com/wiki/index.php/Combobox#API |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Dorg.eclipse.swt.browser.DefaultType=mozilla |