Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
#!/usr/bin/env ruby | |
# checkout the readme from the master branch | |
`git checkout gh-pages; git checkout master README.md` | |
path = `pwd`.gsub(/\n/, "") | |
readme_path = File.join(path, "README.md") | |
index_path = File.join(path, "index.md") | |
# write the index readme file |
class nodejs ( $version, $logoutput = 'on_failure' ) { | |
$nave_path = '/usr/local/bin/nave' | |
$nave_dir = '/usr/local/lib/nave' | |
package { 'bash': | |
ensure => present, | |
} | |
package { 'curl': | |
ensure => present, |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ES5 Data Binding Proof of Concept</title> | |
</head> | |
<body> | |
<section> | |
<label> | |
Name: | |
<input data-bind="name" type="text" /> |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
* Inspired by Filipe Kiss' protip (http://coderwall.com/p/o2hpka), * | |
* I decided to port his PHP variable to JavaScript. * | |
* Do whatever you want with this. Enjoy. Full credit to Filipe. * | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
var status = { | |
100: 'HTTP/1.1 100 Continue', | |
101: 'HTTP/1.1 101 Switching Protocols', |
var cradle = require('cradle'); | |
// change as necessary | |
var host = '127.0.0.1'; | |
var port = 5984; | |
var dbname = 'foo'; | |
// setup cradle db and paginator | |
var conn = new (cradle.Connection)(host, port); | |
var db = conn.database(dbname); |
#!/usr/bin/env sh | |
# Download lists, unpack and filter, write to stdout | |
curl -s https://www.iblocklist.com/lists.php \ | |
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' |
Function.prototype.runOnBackgroundThread = function (aCallback) { | |
var _blob = new Blob(['onmessage = '+this.toString()],{"type":"text/javascript"}); | |
var _worker = new Worker((webkitURL.createObjectURL || URL.createObjectURL)(_blob)); | |
_worker.onmessage = aCallback; | |
_worker.postMessage(); | |
} | |
var _test = function () { | |
postMessage((1+1).toString()); | |
} |
The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:
Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.