Skip to content

Instantly share code, notes, and snippets.

View thrashr888's full-sized avatar
🐮
moo

Paul Thrasher thrashr888

🐮
moo
View GitHub Profile
<?php
public static function getAllFlat($pk = null, $pv = null)
{
if(!$pv)
{
$pv = self::$data;
}
foreach($pv as $k1 => $v1)
{
function initFixFlash(){
embed = '';
holder = '';
flash = '';
jQuery('object').each(function(){
jQuery(this).append('<param value="transparent" name="wmode"/>');
embed = jQuery(this).find('embed');
if (embed != undefined) {
jQuery(this).attr('data', embed.attr('src'));
for mod in `git submodule status | awk '{ print $2 }'`; do git config -f .git/config submodule.${mod}.url `git config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done && git submodule -q sync && git submodule -q update && git clean -q -d -x -f;
<?php
/**
* a feature enabling class
*
* This class has a few methods for enabling or disabling chunks of code.
* It also provides enabling based on user buckets. Most methods are just static.
*
* @author Paul Thrasher
*
@thrashr888
thrashr888 / array-reset.php
Created November 21, 2010 22:08
you can reset an array within a while() but not a foreach();
<?php
$test = array(1,2,3,4,5,6,7,8,9,0);
$find = 4;
foreach($test as $t){
echo $t.',';
if($t=='4' && $find==4){
echo 'found!,';
$find = 6;
reset($test);
}
@thrashr888
thrashr888 / libevent.class.php
Created January 17, 2011 09:40
A class wrapper for PECL Libevent
<?php
/**
* A class wrapper for PECL Libevent [http://www.php.net/manual/en/book.libevent.php]
* @author Paul Thrasher [http://paulthrasher.com/] 1/17/11
**/
/**
* // an example func that just exits
* function handler_func($fd, $events, $arg){ $arg[1]->loopexit(); };
@thrashr888
thrashr888 / dColors.class.php
Created January 26, 2011 19:09
My class that I used to produce and convert color values.
<?php
class dColors{
CONST WHITE = "#FFFFFF";
CONST BLACK = "#000000";
CONST RED = "#FF0000";
CONST GREEN = "#00FF00";
CONST BLUE = "#0000FF";
'width': 460, 'height': 460, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/>
'width': 460, 'height': 460, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/>
'width':620, 'height':380, 'method': 'crop'}) }}" alt="" />
'width': 140, 'height': 120, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}" alt="{{ article.promo_title|raw }}" />
'width':220, 'height':180, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}" alt="" />
'width': 122, 'height': 72, 'method': 'scaleAndCrop'}) }}"/>
'width': 134, 'height': 134, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}"/>
'width':424, 'height':200, 'method': 'scaleAndCrop'}) }}" alt="" />
'width':50, 'height':50, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}" alt="" /></span>
'width': 134, 'height': 134, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}"/>
@thrashr888
thrashr888 / hack.sh
Created April 1, 2012 02:17 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
<?php
// Usage:
// $master=new WebSocket("localhost",12345);
// $master->callback = function($self, $user, $msg){
// $self->send($user->socket,$msg);
// };
require "CommandsAppBase.class.php";
require "WsRequest.class.php";