Deploy a Express.js project on Heroku
Step by step from command line by Michael Hsu
$ express myfirstexpress && cd myfirstexpress
/** | |
* $.unserialize | |
* | |
* Takes a string in format "param1=value1¶m2=value2" and returns an object { param1: 'value1', param2: 'value2' }. If the "param1" ends with "[]" the param is treated as an array. | |
* | |
* Example: | |
* | |
* Input: param1=value1¶m2=value2 | |
* Return: { param1 : value1, param2: value2 } | |
* |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
<?php | |
// Your functions.php content | |
function has_children() { | |
global $post; | |
$pages = get_pages('child_of=' . $post->ID); | |
return count($pages); |
@-webkit-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } | |
100% { background-color: #ccffff; } } | |
@-moz-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } | |
100% { background-color: #ccffff; } } | |
@-ms-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } |
<?php | |
/** | |
* Permutations | |
* | |
* Returns an array of strings containing all the | |
* ($alphabet ^ $output_length) permutations | |
* | |
* @alphabet (string|array) set of at least two elements to choose from | |
* @output_length (int) the number of elements in each output string | |
* |
<?php | |
/* | |
* Foce File Download | |
* Usage: http://example.com/download.php?file=./uploads/image.jpg | |
* | |
* There are a couple of *ninja* exit() as security guarantee, adapt as necessary | |
* | |
*/ | |
// grab the requested file's name |
<?php | |
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR | | |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR); | |
define('ENV', 'dev'); | |
//Custom error handling vars | |
define('DISPLAY_ERRORS', TRUE); | |
define('ERROR_REPORTING', E_ALL | E_STRICT); |
#!/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 |
Step by step from command line by Michael Hsu
$ express myfirstexpress && cd myfirstexpress
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |