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 | |
/** | |
* Created by: Lennart van den Dool <lennartvdd at gmail.com> | |
*/ | |
Class SomeModel | |
{ | |
/** | |
* @var integer The number of decimals to round to | |
* |
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 | |
//determine application environment | |
if(!defined('YII_ENV')) { | |
if(($env = getenv('YII_ENV'))===false) { | |
$env='production';//by default | |
} | |
define('YII_ENV', $env); | |
unset($env); | |
} |
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 | |
$data = file_get_contents("php://input"); | |
if(!$data) | |
die("Missing data"); | |
file_put_contents("postdata_".date("Ymd_His")."_".uniqid().".txt", $data); |
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
#param( | |
# [string]$ProductId, | |
#) | |
# ---- Basic Settings | |
$url = "" | |
$username = "" | |
$password = "" | |
$timeout = 60 * 1000 # 60 seconds | |
# ---- ./ Basic Settings |
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 | |
# == Settings == | |
GIT_DIR=/var/repo/project.git | |
WORK_TREE=/var/www/domain.com | |
BRANCH=master | |
YII_ENVIRONMENT=Production | |
# == Script == |
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 Foo | |
{ | |
/** | |
* not a method with a single responsibility | |
*/ | |
public function __construct() | |
{ |
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 | |
/** | |
* Copyright 2014 by LDiT | |
* Created by: Lennart van den Dool | |
* Date: 2014-10-21 | |
* | |
* Free software, licensed under the BSD License | |
* | |
* IMPORTANT: | |
* this script is not XSS safe. If you need this you will have to implement a CSRF token. |
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
<span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate"> | |
<span itemprop="rating" style="display:none;">4</span> | |
<span itemprop="count" style="display:none;">1</span> | |
</span> | |
<!-- SHOULD BECOME --> | |
<span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> | |
<span itemprop="ratingValue" style="display:none;">4</span> | |
<span itemprop="reviewCount" style="display:none;">1</span> |
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/sh | |
# This script does backups to a remote server over ssh. the account running this script | |
# must have ssh access to the remote server using passwordless key authentication. | |
# perform: | |
# > ssh-keygen -q | |
# > ssh-copy-id [username]@[hostname] | |
# test with: `ssh [username]@[hostname]` & add script to cron | |
# > crontab -e | |
# #backup: every day @ 03:30 & log output. |
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
# Set php version through phpenv. 5.3, 5.4 and 5.5 available | |
phpenv local 5.4 | |
# == configure composer | |
composer config -g github-oauth.github.com $GITHUB_ACCESS_TOKEN # configure env var in project settings! | |
# == install composer global dependencies | |
composer global require "phpunit/phpunit=4.3.*" | |
composer global require "phpunit/phpunit-selenium" | |
composer global require "phpunit/php-invoker" |
OlderNewer