Skip to content

Instantly share code, notes, and snippets.

View drewjoh's full-sized avatar

Drew Johnston drewjoh

View GitHub Profile
@drewjoh
drewjoh / timezones.min.php
Created October 11, 2011 03:59
List of all timezones compatible with the PHP DateTimeZone object.
$timezones = array('UTC','Africa/Abidjan','Africa/Accra','Africa/Addis_Ababa','Africa/Algiers','Africa/Asmara','Africa/Asmera','Africa/Bamako','Africa/Bangui','Africa/Banjul','Africa/Bissau','Africa/Blantyre','Africa/Brazzaville','Africa/Bujumbura','Africa/Cairo','Africa/Casablanca','Africa/Ceuta','Africa/Conakry','Africa/Dakar','Africa/Dar_es_Salaam','Africa/Djibouti','Africa/Douala','Africa/El_Aaiun','Africa/Freetown','Africa/Gaborone','Africa/Harare','Africa/Johannesburg','Africa/Juba','Africa/Kampala','Africa/Khartoum','Africa/Kigali','Africa/Kinshasa','Africa/Lagos','Africa/Libreville','Africa/Lome','Africa/Luanda','Africa/Lubumbashi','Africa/Lusaka','Africa/Malabo','Africa/Maputo','Africa/Maseru','Africa/Mbabane','Africa/Mogadishu','Africa/Monrovia','Africa/Nairobi','Africa/Ndjamena','Africa/Niamey','Africa/Nouakchott','Africa/Ouagadougou','Africa/Porto-Novo','Africa/Sao_Tome','Africa/Timbuktu','Africa/Tripoli','Africa/Tunis','Africa/Windhoek','America/Adak','America/Anchorage','America/Anguilla','Ameri
@larryli
larryli / after.sh
Last active April 20, 2016 13:29
laravel homestead install phalcon and remove postgresql/memcached/beanstalkd/redis
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
# install phalcon
phalcon_so="`php-config --extension-dir`/phalcon.so"
if [ ! -f $phalcon_so ]; then
# apt-get install -y php5-dev php5-mysql gcc libpcre3-dev
@jarektkaczyk
jarektkaczyk / laravel-tinker-RouteList-helper.php
Created September 8, 2016 02:49
Handy helper for working with route list in tinker [Laravel]
<?php
// Easily get route list in tinker
>>> app('RouteList')->setOption('method', 'PUT')->getRoutes()
>>> app('RouteList')->getRoutes()->where('name', 'website.login')
class RouteList extends \Illuminate\Foundation\Console\RouteListCommand
{
/** @var array */
@hotmeteor
hotmeteor / php-openssl.md
Last active December 10, 2017 07:21 — forked from ryanscherler/php-openssl.md
Use Homebrew PHP with OpenSSL instead of SecureTransport
@pjmazenot
pjmazenot / migrate-mamp-to-mysql-5.7.sh
Last active December 29, 2017 00:59 — forked from dj1020/migrate.sh
Upgrade MAMP to MySQL 5.7 tested 2016/03/20
#!/bin/sh
# Original by Ken Lin
# Updated by Pierre-Julien Mazenot
#
# - Mysql version 5.7.9 -> 5.7.11
# - Comments
#
# Additional notes after last tests
#
@dj1020
dj1020 / migrate.sh
Last active February 5, 2019 13:05 — forked from tobi-pb/migrate.sh
Upgrade MAMP to Mysql 5.7 tested by Ken Lin 2015/11/09
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@richthegeek
richthegeek / cache_filter.php
Created March 8, 2012 16:24
Variable microcaching with Laravel
<?php
Route::filter('cache', function($response = NULL) {
$cname = 'response-' . Str::slug(URI::full());
if (!$response) {
return Cache::get($cname);
}
else if ($response->status == 200) {
$ctime = floor(pow(current(sys_getloadavg()) + 1, 5)); # cache for between 1 and 32 minutes
Cache::put($cname, $response, $ctime);
@alanhamlett
alanhamlett / requirements.txt
Last active March 21, 2019 00:02
WakaTime's requirements.txt Python dependencies
-e git://github.com/kennethreitz/inbox.py.git@551b4f44b144564504c687cebdb4c543cb8e9adf#egg=inbox
alembic==0.8.3
amqp==1.4.9
anyjson==0.3.3
boto==2.39.0
braintree==3.20.0
cairosvg==1.0.19
celery==3.1.20
@taylorotwell
taylorotwell / weather.sh
Last active August 27, 2019 13:40
Weather CLI
alias weather='curl -s wttr.in | sed -n "1,7p"'
@alexandrevicenzi
alexandrevicenzi / index.html
Last active September 22, 2020 21:01
Bootstrap CSS Animate Loading Icon Button
<!-- Code snippet -->
<div class="form-group">
<div class="col-md-12 text-center">
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
</div>
</div>