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 | |
# Allows running phpcs on files that are going to be committed within src/ folder | |
# | |
# ### Prerequisites and configuration | |
# | |
# Set git config variable that points to phpcs rules folder (you have to do this once) | |
# | |
# `git config --global user.phpcs-standard ~/path/of/coding-standard` | |
# | |
# Require phpcs for your project (if not already done. You can check it with `composer info`) |
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 | |
use PHPUnit\Framework\TestCase; | |
class DataTest extends TestCase | |
{ | |
/** | |
* @dataProvider myProvider | |
*/ | |
public function testMethod($a, $b, $expected) | |
{ |
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 | |
#Generates an mp4 from a bunch of images overlaying data | |
#Requires imagemagick and ffmpeg | |
#Generates the temporary images overlaying the date we wont | |
for i in *.jpg; do | |
echo $i | |
convert $i -pointsize 48 -gravity NorthWest -annotate 0 "%[date:modify]" tmp-$i | |
done | |
#make a 2hz video with the images |
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 | |
/** | |
* Trait BitmaskTrait | |
* Sometimes you need to work with bits... to manage permissions or statuses. | |
* https://gist.github.com/fcamp | |
* | |
* @link http://stackoverflow.com/questions/1277470/looking-for-real-world-examples-of-bitwise-operations-in-php | |
* @link http://blog.code-head.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php | |
* @link http://php.net/manual/it/language.operators.bitwise.php#108679 | |
*/ |
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 | |
/** | |
* Just a tiny Wrapper of ob_start / ob_end | |
* @author https://github.com/fcamp | |
*/ | |
class Phonograph | |
{ | |
private static $data = []; | |
private static $currentName = null; |
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
# http://stackoverflow.com/questions/2862590/how-to-replace-master-branch-in-git-entirely-from-another-branch | |
# Overwrite a branch (branch_old) with another (branch_new) | |
git checkout branch_new | |
git merge -s ours branch_old | |
git checkout branch_old | |
git merge branch_new |