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
#add following lines into the ~/.profile file | |
alias svstart='sudo nginx && mysql.server start && sudo php-fpm' | |
alias svstop='sudo nginx -s stop && mysql.server stop && sudo killall php-fpm' | |
alias svrestart='svstop && svstart' |
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 | |
$url = 'http://www.example.com'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_USERPWD, "myusername:mypassword"); | |
$result = curl_exec($ch); | |
echo $result; |
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 | |
function array_delete_by_key(&$array, $delete_key, $use_old_keys = FALSE) { | |
unset($array[$delete_key]); | |
if(!$use_old_keys) { | |
$array = array_values($array); | |
} |
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 | |
function powerSet($in,$minLength = 1) { | |
$count = count($in); | |
$members = pow(2,$count); | |
$return = array(); | |
for ($i = 0; $i < $members; $i++) { | |
$b = sprintf("%0".$count."b",$i); | |
$out = array(); | |
for ($j = 0; $j < $count; $j++) { |
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/sh | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
echo "[PRECOMMIT HOOK] Running tests" | |
if [[ -e "libs/bin/phpunit" ]]; then | |
if [[ -d "tests" ]]; then |
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 | |
/** | |
* CountryFacade.php | |
* | |
* @author Jiří Šifalda <[email protected]> | |
* | |
* @date 01.12.12 | |
*/ | |
class CountryFacade extends \Nette\Object |
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
var deps = [ | |
'/js/libs/jquery.min.js', | |
'/js/libs/address.min.js', | |
'/js/libs/ui.min.js', | |
'/js/libs/prefixfree.min.js', | |
'/js/libs/modernizr.js', | |
'/js/libs/jqtube.js', | |
'/js/core.js', | |
'/js/yt.js', |
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
"repositories": [ | |
{ | |
"type": "package", | |
"package": { | |
"name": "vendor/package", | |
"version": "1.0.0", | |
"dist": { | |
"url": "http://example.org/package.zip", | |
"type": "zip" | |
}, |
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
# Create local repo | |
cd ~ | |
mkdir repositories | |
cd repositories | |
mkdir localRepo.git | |
cd localRepo.git | |
git init --bare --shared=true | |
# Add remote to local repo in your project | |
cd myProject |
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
"repositories": [ | |
{ | |
"type": "package", | |
"package": { | |
"name": "enlan/categorymodule", | |
"version": "master", | |
"source": { | |
"url": "<git-url>", | |
"type": "git", | |
"reference": "master" |