##Install Xcode command line tools
Xcode>Preferences>Downloads
Enable root if not already enabled: http://support.apple.com/kb/PH11331?viewlocale=en_US
##Apache
Apache is already installed, just not running.
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
# ~/code/web:beta_directory$ git checkout master | |
# Switched to branch "master" | |
# ~/code/web:master$ git checkout beta_directory | |
# Switched to branch "beta_directory" |
RegExp.prototype.findAll = function(str) { | |
var match = null, results = []; | |
while ((match = this.exec(str)) !== null) { | |
switch (match.length) { | |
case 1: | |
results[results.length] = match[0]; | |
break; | |
case 2: | |
results[results.length] = match[1]; | |
break; |
//from: http://stackoverflow.com/questions/934012/get-image-data-in-javascript | |
function getBase64Image(img) { | |
// Create an empty canvas element | |
var canvas = document.createElement("canvas"); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
// Copy the image contents to the canvas | |
var ctx = canvas.getContext("2d"); |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
##Install Xcode command line tools
Xcode>Preferences>Downloads
Enable root if not already enabled: http://support.apple.com/kb/PH11331?viewlocale=en_US
##Apache
Apache is already installed, just not running.
#!/bin/bash | |
echo '#!/bin/bash' | |
echo '' | |
echo 'failed_items=""' | |
echo 'function install_package() {' | |
echo 'echo EXECUTING: brew install $1 $2' | |
echo 'brew install $1 $2' | |
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.' | |
echo '}' |
<?php | |
ini_set('display_errors', 1); | |
/** | |
* This script check how PHP makes HTTPS (SSL/TLS) requests using PHP Streams | |
* or cURL. Configuration options are passed as GET parameters, for example: | |
* http://localhost/checksslcontext.php?reconfigure=1 | |
* | |
* Configuration: | |
* http://localhost/checksslcontext.php | |
* Basic PHP Streams using file_get_contents(). Default settings. |
[ | |
{ | |
"use_channel":true, | |
"allow_empty_post_data":true, | |
"app_id":"edaded98-5119-4c8a-afc1-de722da03562", | |
"url":"http://chromecast.redbull.tv/receiver.php", | |
"dial_enabled":true | |
}, | |
{ | |
"use_channel":true, |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
// Create Base64 Object | |
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r |