To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
var BASE64_MARKER = ';base64,'; | |
function convertDataURIToBinary(dataURI) { | |
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; | |
var base64 = dataURI.substring(base64Index); | |
var raw = window.atob(base64); | |
var rawLength = raw.length; | |
var array = new Uint8Array(new ArrayBuffer(rawLength)); | |
for(i = 0; i < rawLength; i++) { |
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specifiy | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
var data = "do shash'owania"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
// convert 0..255 R,G,B values to binary string | |
RGBToBin = function(r,g,b){ | |
var bin = r << 16 | g << 8 | b; | |
return (function(h){ | |
return new Array(25-h.length).join("0")+h | |
})(bin.toString(2)) | |
} | |
// convert 0..255 R,G,B values to a hexidecimal color string | |
RGBToHex = function(r,g,b){ |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
alias ng="npm list -g --depth=0 2>/dev/null" | |
alias nl="npm list --depth=0 2>/dev/null" |
# Can force this into php/recipes/package.rb | |
# Or if you're like me and use a cookbook to provision with chef-solo... | |
# add this near the top of your file before you update apt | |
# Use PHP 5.4 | |
apt_repository "php54" do | |
uri "http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu" | |
distribution node['lsb']['codename'] | |
components ["main"] | |
keyserver "keyserver.ubuntu.com" |
/** | |
* Returns value of specified URL parameter. | |
* @param {String} name Query parameter to return value of. | |
* @return {String} String of query parameter or null / 0. | |
*/ | |
getUrlParameter = function(name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#?]*)').exec(window.location.href); | |
if (results==null){ return null; } | |
else { return results[1] || 0; } | |
} |