Github will be the main account and bitbucket the secondary.
ssh-keygen -t rsa -C "github email"
Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.
# 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 |
helpers.php
file in your app
directorycomposer.json
manifest file to auloload this file: "autoload": {
"files": [
"app/helpers.php"
],
// ...
function hostReachable() { | |
// Handle IE and more capable browsers | |
var xhr = new ( window.ActiveXObject || XMLHttpRequest )( "Microsoft.XMLHTTP" ); | |
var status; | |
// Open new request as a HEAD to the root hostname with a random param to bust the cache | |
xhr.open( "HEAD", "//" + window.location.hostname + "/?rand=" + Math.floor((1 + Math.random()) * 0x10000), false ); | |
// Issue request and handle response |
<?php | |
/** | |
* Tyler Whitney | |
* | |
* PHP Command line script that recursively finds and replaces a string within files of directories. | |
* | |
* Useage: php script.php DIRECTORY SEARCH-STRING REPLACE-STRING (PARTIAL-FILE-NAME-MATCH) | |
* | |
* The script will replace all strings matching SEARCH-STRING within all files inside of DIRECTORY and its sub-directories with REPLACE-STRING. | |
* If you provide the option PARTIAL-FILE-NAME-MATCH it will only replace occurences in files that their filenames contain the partail search. |
mongodump -h xxx11.mlab.com:11 -u user -p password --authenticationDatabase release-db -d release-db -o /home/dumps
**Options** `-h`: mlab host:port, `-u`: db user, `-p`: db user password, `--authenticationDatabase` `-d`: mlab dbname, `-o`: path to store backupfiles
restore command, to restore locally
mongorestore --db dname /home/dumps
Otherwise to restore in mlab, create a new db and replace the options
<?php | |
// using generators (yield) to recursively read files from a source path | |
// more: http://www.php.net/manual/en/language.generators.php | |
foreach (readFileSubDir('~/testdir') as $fileItem) { | |
echo($fileItem . "\n"); | |
} | |
function readFileSubDir($scanDir) { |
<html> | |
<head> | |
<title>HTML & CSS tree</title> | |
<!-- tree --> | |
<style type="text/css"> | |
ul.tree { | |
overflow-x: auto; | |
white-space: nowrap; | |
} |
<?php | |
// ftp_sync - copy directory and file structure | |
// based on http://www.php.net/manual/es/function.ftp-get.php#90910 | |
// main function witch is called recursivly | |
function ftp_sync($dir, $conn_id) { | |
if ($dir !== '.') { | |
if (ftp_chdir($conn_id, $dir) === FALSE) { | |
echo 'Change dir failed: ' . $dir . PHP_EOL; | |
return; |
// long version | |
function loadExt(files, after) { | |
var _this=this; | |
_this.files = files; | |
_this.js = []; | |
_this.head = document.getElementsByTagName("head")[0]; | |
_this.after = after || function(){}; | |
_this.loadStyle = function(file) { | |
var link = document.createElement("link"); | |
link.rel = "stylesheet"; |