This file contains 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 | |
/** | |
* PHP Quiz #1 | |
* | |
* What is the function definition of hello()? | |
* | |
* function hello() { | |
* ... | |
* } |
This file contains 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 | |
# | |
# Deploy on push. Use different strategies on different branches. | |
# | |
function deploy_branch() { | |
# set branch path | |
case "$1" in | |
"master") | |
export GIT_WORK_TREE=/home/web/example.com ;; |
This file contains 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/php | |
<?php | |
function deploy($branch) { | |
$branchPaths = array( | |
'master' => '/home/web/example.com', | |
'develop' => '/home/web/test.example.com' | |
); | |
if (array_key_exists($branch, $branchPaths)) { |
This file contains 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
Ref. https://twitter.com/atmoz/status/255077724740276224 | |
and the following discussion. | |
Quote: "The foundations of society should be built in the same way buildings | |
are – with scientific methods, not by voting for political parties." | |
First off all, by "foundations" I mean, for example (but not limited to), the | |
basic understanding for human needs and how to satisfy them. To expand my | |
analogy of buildings: we use science to determine the foundation before placing | |
walls. We need to know how much material we got, and calculate and distribute |
This file contains 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 CustomModule extends CWebModule { | |
private $assetsUrl; | |
/** | |
* Publish assets by copying files to public assets folder, | |
* accessable by clients. | |
*/ |
This file contains 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
<h1>My first post</h1> | |
<p>So this is how it looks</p> | |
<p>My second paragraph</p> |
This file contains 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 | |
dbContainer="db" | |
userTable="wordpress.users" | |
username=${1:-"admin"} | |
password=${2:-"$username"} | |
passwordHash=$(docker run --rm -it -v $(pwd)/www:/www php:5.4-cli php -r "\ | |
include '/www/wp-includes/pluggable.php';\ | |
define('ABSPATH', '/www/');\ |
This file contains 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 (a) { | |
do A | |
if (b) { | |
do B | |
if (c) { | |
do C | |
} | |
else { |
This file contains 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 | |
# | |
# NAME | |
# junit - run JUnit tests with ease | |
# | |
# USAGE | |
# junit [FILE... | CLASS... | DIR] | |
# | |
# EXAMPLES | |
# junit |
This file contains 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
Connection='wireless' | |
Interface=wlp3s0 | |
Security='wpa-configsection' | |
Description="eduroam network" | |
IP='dhcp' | |
TimeoutWPA=30 | |
WPAConfigSection=( | |
'ssid="eduroam"' | |
'key_mgmt=WPA-EAP' | |
'eap=PEAP' |
OlderNewer