git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
<?php | |
/** | |
* Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7 | |
* @param str $hex Colour as hexadecimal (with or without hash); | |
* @percent float $percent Decimal ( 0.2 = lighten by 20%(), -0.4 = darken by 40%() ) | |
* @return str Lightened/Darkend colour as hexadecimal (with hash); | |
*/ | |
function color_luminance( $hex, $percent ) { | |
// validate hex string |
<?php | |
if (!defined('BASEPATH')) | |
exit('No direct script access allowed'); | |
class assets extends CI_Controller { | |
function __construct() { | |
parent::__construct(); |
//nesting thens | |
casper.then(function () { | |
this.log('THEN #1', 'info', 'then'); | |
this.then(function () { | |
this.log('THEN #2', 'info', 'then'); | |
this.then(function () { | |
this.log('THEN #3', 'info', 'then'); | |
}); | |
this.log('THEN #4', 'info', 'then'); |
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
sudo vim /etc/postfix/sasl_passwd
<? | |
//personal auth token from your github.com account. doing this will eliminate having to use oauth everytime | |
$token = "zzzzzzzzYourPersonalGithubAccessTokenzzzzzzzz"; | |
//post url, https://developer.github.com/v3/issues/ | |
$url = "https://api.github.com/repos/octocat/some_repo/issues?access_token=" . $token; | |
//request details, removing slashes and sanitize content | |
$title = htmlspecialchars(stripslashes("Test Title''\s"), ENT_QUOTES); | |
$body = htmlspecialchars(stripslashes("Test Body'\'$%'s"), ENT_QUOTES); |
version: '2' | |
services: | |
web: | |
image: php:apache | |
restart: unless-stopped | |
volumes: | |
- $PWD:/var/www | |
ports: | |
- 80:80 |
<?php | |
namespace Tests\Concerns; | |
use App\Models\User; | |
use Tymon\JWTAuth\Facades\JWTAuth; | |
trait AttachJwtToken | |
{ | |
/** |
<html> | |
<head> | |
<title>CSS Transform Scale element to fit its parent</title> | |
<script src="scale2fit.js"></script> | |
<link rel="stylesheet" href="style.css"/> | |
<script> | |
(function(window) { | |
function main() { | |
const margin = 10; | |
requestAnimationFrame(function fitToParentOnResize() { |