Skip to content

Instantly share code, notes, and snippets.

View kivlor's full-sized avatar

Andrew Gallagher kivlor

View GitHub Profile
/*
Uploadify v2.1.4
Release Date: November 8, 2010
Copyright (c) 2010 Ronnie Garcia, Travis Nickels
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@kivlor
kivlor / gist:2232687
Created March 29, 2012 02:39
Find files and copy to destination
find . -name '*.html' | xargs -I {} /bin/cp {} /copy/to/destination/
@kivlor
kivlor / codepen.php
Last active September 17, 2021 23:22
PHP Code Pen
<?php
/*
This is a very dirty implementation of a 'code pen' for quickly testing small snippets of PHP code.
- It will eval anything and everything entered into the code field
- It should only ever be used on a local machine, never on the dev servers and espiacally never on a live server
USE WITH CAUTION!
function(k, v) {
return v.a ? v.a.map(function(x) {
return x.k
}) : [v.k]
}
@kivlor
kivlor / Preferences.sublime-settings
Last active December 17, 2015 12:09
sublime settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Tomorrow-Night-Bright.tmTheme",
"file_exclude_patterns":
[
".DS_Store",
"._.DS_Store",
"*.swp",
"*.swo"
],
@kivlor
kivlor / block_ascii.txt
Last active December 21, 2015 20:59
A bunch of block ascii. Perfect for your motd file ( ^__^)b
Sonic:
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒████▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░░
▒▒▒▒░░░░░░░░░░██▒▒▒▒██████▒▒▒▒░░░░░░
▒▒░░░░░░░░░░▒▒░░██▒▒▒▒████████▒▒░░░░
░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒████████▒▒░░
░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒██████████▒▒
░░░░░░░░░░▒▒▒▒▒▒░░░░▒▒████████▒▒
░░░░░░▒▒▒▒▒▒░░▒▒▒▒░░▒▒▒▒██▒▒▒▒▒▒
<?php
function encode_ean13($number)
{
// String it and make it the right length
$digits = (string)$number;
$digits = strlen($digits) < 12 ? str_pad($digits, 12, '0', STR_PAD_LEFT) : $digits;
// Add the values of the digits in the even-numbered positions: 2, 4, 6, etc.
$even_sum = $digits{1} + $digits{3} + $digits{5} + $digits{7} + $digits{9} + $digits{11};

After an apt-get upgrade on my Forge box, both php and nginx got upgraded, and while browsing my sites, PHP FPM was being hit by nginx, but it returned nothing, zilch, nada.

Nothing on laravel.log.

Something in the nginx log:

10.10.10.10 - - [23/Sep/2014:11:52:09 -0300] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
<?php
use Illuminate\Console\Command;
class DebugCommand extends Command
{
/**
* The console command name.
*
* @var string
@kivlor
kivlor / ticker.php
Created June 16, 2015 01:07
Silly little ticker...
<?php
$iteration = 0;
$ttl = 5;
$tickerCharacters = ['|','\\','-','/'];
while ($ttl > 0) {
$ttl -= 0.05;
time_nanosleep(0, 50000000);
echo "\033[1D";