Skip to content

Instantly share code, notes, and snippets.

View Twipped's full-sized avatar
💭
Furiously innovating

Jocelyn Badgley Twipped

💭
Furiously innovating
View GitHub Profile
@Twipped
Twipped / gist:2008201
Created March 9, 2012 19:23
Sad tale
<Greed> You guys wanna hear something fucked?
<olleman> we're on the internet, after all
koala_bot waits for it
<Greed> The previous owner of my cell phone number died in a car crash involving a drunk driver.
<Greed> His mom, who has dementia, calls me 10-14 times per week and leaves messages asking when 'Thomas' is going to come home and stop dallying around with his friends
<Greed> Or when he's going to come vistit her
<Greed> Or asking Thomas what's for dinner
<Greed> Or pleading with him to call her more
<olleman> dude.
<Greed> And if I pick up the number and explain to her that I'm not Thomas
@Twipped
Twipped / gist:2176817
Created March 24, 2012 00:43
How many different ways can we use "static"?
static function Q() {
static $o;
if (!$o) $o = new static();
return $o;
}
@Twipped
Twipped / gist:2220090
Created March 27, 2012 20:38
The shit I do to get iOS keyboard focusing to work...
$section.iscroller = new iScroll($page[0]);
$page.on('focus', 'input, textarea', function () {
//prevent page scrolling
$page[0].scrollTop = 0;
window.pageYOffset = 0;
window.scrollTop = 0;
document.body.scrollTop = 0;
setTimeout(function () {
//NO REALLY, DON'T SCROLL THE FUCKING PAGE!
$page[0].scrollTop = 0;
@Twipped
Twipped / example.php
Created April 19, 2012 19:30
Example PHP Class
class Foo {
public $memberProperty;
static $staticProperty = array(10, 23, 104);
function memberFunction () {
$localVariable = 1;
}
@Twipped
Twipped / singleton.php
Created April 19, 2012 22:08
Quick and dirty Singleton class
class BadExample {
static function Singleton() {
static $o;
if (!$o) $o = new static();
return $o;
}
}
@Twipped
Twipped / gist:2727313
Created May 18, 2012 19:57
netfinity job listing

#Telecommute/remote full-time position: PHP Backend Developer and/or Frontend Developer

Established in 1998, NFY Interactive is a small web development firm based out of San Diego. Virtualized since 2010, all of our team members work from their home offices, communicating via email, IM and video conferencing. We specialize in multiple areas including custom web application development and CMS driven websites, email marketing campaigns, SEO, and mobile development for organizations such as ConocoPhillips and Coldwell Banker.

We have an immediate need for qualified candidates for one or more full-time positions in a hired or contract-to-hire capacity. Prospective applicants should have at least two years of professional experience, or demonstrable proficiency. No formal education is necessary as long as applicant can show that they meet the requirements and are eager to learn more.

##PHP/MySQL Backend Developer

Responsibilities:

@Twipped
Twipped / gist:2939809
Created June 16, 2012 03:31
TwitterMostFollowed
#!/usr/bin/env node
var request = require('request');
var async = require('async');
var db = require('dirty')('followers.db');
var oauth = {
consumer_key: '',
consumer_secret: '',
token: '',
token_secret: ''
@Twipped
Twipped / API.php
Created June 26, 2012 20:08
InfusionSoft API Class
<?php
namespace InfusionSoft;
use \SimpleXMLElement, \DateTime;
class API {
public $key = '';
public $application = '';
@Twipped
Twipped / array_cross.php
Created July 25, 2012 06:13
array_cross
<?php
function array_cross() {
$arrays = func_get_args();
//force indexed arrays, stripping any extra keys.
array_walk($arrays, function (&$n) {
return is_array($n) ? array_values($n) : null;
# request for root gets passed directly to Primal
location = / {
rewrite ^ /index.php last;
}
# request for anything that doesn't exist, pass it to PHP
location / {
if (!-e $request_filename) {
rewrite ^ /index.php last;
}