Skip to content

Instantly share code, notes, and snippets.

View snipe's full-sized avatar
😩
So jetlag. Much tired.

snipe snipe

😩
So jetlag. Much tired.
View GitHub Profile
// Modified version of the timezone list function from http://stackoverflow.com/a/17355238/507629
// Includes current time for each timezone (would help users who don't know what their timezone is)
function generate_timezone_list($val = NULL)
{
static $regions = array(
DateTimeZone::AFRICA,
DateTimeZone::AMERICA,
DateTimeZone::ANTARCTICA,
DateTimeZone::ASIA,
@snipe
snipe / gist:741e6c1df72db7059ddc
Last active August 27, 2015 23:47 — forked from jkeck/gist:3515705
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id and is classed with modal and permalink:
<div class="modal permalink" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@snipe
snipe / keybase.md
Created March 20, 2014 23:56
verification

Keybase proof

I hereby claim:

  • I am snipe on github.
  • I am snipe (https://keybase.io/snipe) on keybase.
  • I have a public key whose fingerprint is C1CC 3935 03A5 D855 6602 F7C1 F564 2C61 1290 D7CC

To claim this, I am signing this object:

@snipe
snipe / gist:4aa434c53b65fd23c401
Created June 9, 2014 22:42
Encrypt Slack token with Travis' encryption cli interface
travis encrypt "snipe:<SLACK TOKEN>" --add notifications.slack
Verifying that +snipe is my openname (Bitcoin username). https://onename.io/snipe
@snipe
snipe / gist:3e82c2c9288f761315eb
Created February 28, 2015 22:46
Versioning.php Artisan command for generating a version config for Laravel 4
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class Versioning extends Command {
/**
* The console command name.
@snipe
snipe / gist:1469447
Created December 12, 2011 22:31 — forked from irohiroki/gist:909284
jQuery Mobile Red and Green themes for Buttons
/* F
-----------------------------------------------------------------------------------------------------------*/
.ui-btn-up-f, .ui-btn-hover-f, .ui-btn-down-f {
color: white;
font-weight: bold;
text-decoration: none; }
.ui-btn-up-f {
border: 1px solid #711414;
background: #ab2525;
@snipe
snipe / gist:1925906
Created February 27, 2012 18:07
Add/remove fields dynamically in jQuery Mobile, disable buttons once max/min fields reached
<script>
/*
See the full details here:
http://www.snipe.net/2012/02/jquery-mobile-add-remove-fields-dynamically/
Based on the great post by Charlie Griefer, available here:
http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/
*/
@snipe
snipe / headers-in-bed
Created November 1, 2012 03:23
HTTP Error codes as fortune cookies
100 Continue (in bed)
101 Switching Protocols (in bed)
102 Processing (in bed)
200 OK (in bed)
201 Created (in bed)
202 Accepted (in bed)
203 Non-Authoritative Information (in bed)
204 No Content (in bed)
205 Reset Content (in bed)
206 Partial Content (in bed)
@snipe
snipe / currency_list
Created November 4, 2015 06:31 — forked from MindaugasR/currency_list
World Currency list in PHP Array
array (
'ALL' => 'Albania Lek',
'AFN' => 'Afghanistan Afghani',
'ARS' => 'Argentina Peso',
'AWG' => 'Aruba Guilder',
'AUD' => 'Australia Dollar',
'AZN' => 'Azerbaijan New Manat',
'BSD' => 'Bahamas Dollar',
'BBD' => 'Barbados Dollar',
'BDT' => 'Bangladeshi taka',