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 | |
$monster = [ | |
'health' => 100, | |
'aps' => 1.3, | |
'damage' => 40 | |
]; | |
$player = [ | |
'health' => 1000, |
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 | |
class TSX { | |
/** | |
* Holds the map indexed by tile GID | |
* | |
* @var array | |
*/ | |
private $map = []; |
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
// Usage | |
let g = new Gravatar; | |
return g.setEmail('your_email') | |
.setRating('x') | |
.setSize(40) | |
.setImageSet('monsterid') | |
.getAvatar() |
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 | |
namespace App\Http\Middleware; | |
use Carbon\Carbon; | |
use Closure; | |
class TimerCheck | |
{ | |
/** |
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 | |
// app/Rules/CountryExists.php | |
namespace App\Rules; | |
use Illuminate\Contracts\Validation\Rule; | |
class CountryExists implements Rule | |
{ |
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 | |
return [ | |
'AF' => 'Afghanistan', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', | |
'AD' => 'Andorra', | |
'AO' => 'Angola', | |
'AI' => 'Anguilla', |
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
function gitconfig { | |
if [ "$1" == "" ]; then | |
echo "Empty username (Usage gitconfig username email)" | |
else | |
git config user.name "$1" | |
echo "Set git username to $1" | |
fi |
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
#!/usr/bin/python | |
from AppKit import NSWorkspace | |
import time | |
t = range(1,100) | |
for i in t: | |
time.sleep(3) | |
activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName'] | |
print activeAppName |
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 gulp = require('gulp'); | |
var runSequence = require('run-sequence'); | |
var minifyCss = require('gulp-minify-css'); | |
var buildDir = './build/'; | |
var minifyCssSettings = { advanced: true, aggressiveMerging: true }; | |
// Main build | |
gulp.task('build', function() { |
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
#Twig Field Errors | |
Currently there was no easy way of adding errors to a standard twig / laravel build, so I created a quick filter and thought I would share, nothing crazy but hopefully someone else might find it useful. | |
##Install | |
Copy the below code into `lwig.php` within the extensions directory, if you don't have one follow the quick step below | |
#####If no extension directory: | |
* Create a directory under `app/` named `lextra` (or whateer you want). | |
* In your composer make sure you are autoloading that directory `"app/lextra"`. | |
* Run `composer dumpautoload` to generate the autoload file |
NewerOlder