This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# place in ~/bin or a PATH directory | |
# | |
# usage: | |
# | |
# $ cd /path/to/site | |
# $ serve-static 8443 | |
# | |
# port number defaults to 8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# bin folder | |
cd ~ | |
mkdir -p ~/bin | |
# base apps and upgrade | |
sudo apt-get update | |
sudo apt-get install -y aptitude curl vim git unzip openssl | |
sudo aptitude -y safe-upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function create_index | |
{ | |
cat <<- __EOF__ | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>$PROJECT</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('random_bytes')) { | |
function random_bytes($length) | |
{ | |
$buffer = ''; | |
$valid = false; | |
if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) { | |
$buffer = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); | |
if ($buffer) { | |
$valid = true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo -n "==> Choose a password for MySQL and phpMyAdmin: " | |
read PASSWORD | |
echo -n "==> Enter your full name for Git configuration: " | |
read FULLNAME | |
echo -n "==> Enter your email address for Git configuration: " | |
read EMAILADD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1` | |
sudo setfacl -R -m u:$APACHEUSER:rwX -m u:`whoami`:rwX app/storage | |
sudo setfacl -dR -m u:$APACHEUSER:rwX -m u:`whoami`:rwX app/storage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"ensure_newline_at_eof_on_save": true, | |
"folder_exclude_patterns": | |
[ | |
".svn", | |
".git", | |
".hg", | |
"CVS", | |
".vagrant", | |
".idea" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<!-- | |
====================================================================== | |
JohnnyFive | |
====================================================================== | |
A Sublime Text 2 / Textmate theme. | |
Copyright (c) 2014 John Nickell | |
Released under the MIT License <http://opensource.org/licenses/MIT> | |
====================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DayCalc | |
{ | |
protected static $weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; | |
public static function getWeekDay($year, $month, $day) | |
{ | |
$total = static::getTotalDays($year, $month, $day); | |
$i = $total % 7; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ResourceLocator implements ResourceLocatorInterface | |
{ | |
protected $defaultMap; | |
protected $schemes = []; | |
public function __construct(UriPathMapInterface $defaultMap = null) | |
{ | |
$this->defaultMap = $defaultMap ?: new UriPathMap(); |
NewerOlder