Skip to content

Instantly share code, notes, and snippets.

View robotamer's full-sized avatar

TaMeR robotamer

View GitHub Profile
@robotamer
robotamer / rstrstr.php
Created April 21, 2011 08:39
php rstrstr
<?php
/**
* @author : Dennis T Kaplan
*
* @version : 1.0
* Date : June 17, 2007
* Function : reverse strstr()
* Purpose : Returns part of haystack string from start to the first occurrence of needle
* $haystack = 'this/that/whatever';
* $result = rstrstr($haystack, '/')
@robotamer
robotamer / addInclude.php
Created May 11, 2011 06:49
Add a directory to the php include path
<?php
/**
* Description Add a directory to the php include path
*
* @package TaMeR
* @category File
* @type Function
* @author Dennis T Kaplan
* @copyright (C) 2009-2011 Dennis T Kaplan
* @license GPL {@link http://www.gnu.org/licenses/gpl.html}
@robotamer
robotamer / Strsafe.php
Created December 3, 2011 10:36
Encode, decode and also serialize when nessesery
<?php
/**
* An open source application development framework for PHP
*
* @category RoboTaMeR
* @author Dennis T Kaplan
* @copyright Copyright (c) 2008 - 2011, Dennis T Kaplan
* @license http://RoboTamer.com/license.html
* @link http://RoboTamer.com
*/
@robotamer
robotamer / KvLite.php
Created December 3, 2011 10:43
key value database based on Sqlite
<?php
/**
* An open source application development framework for PHP
*
* @category RoboTaMeR
* @author Dennis T Kaplan
* @copyright Copyright (c) 2008 - 2011, Dennis T Kaplan
* @license http://RoboTamer.com/license.html
* @link http://RoboTamer.com
*/
@robotamer
robotamer / network_Safety_Restart.sh
Created December 15, 2011 03:57
"network_Safety_Restart.sh start" Will move /etc/network/interfaces.org to /etc/network/interfaces and restart the server after a given time. You can stop the script by issuing a "network_Safety_Restart.sh stop"
#! /bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/lsb/init-functions
export FILE=/etc/network/interfaces
case "$1" in
start)
SLEEPFOR=1200
@robotamer
robotamer / dtuple.py
Created January 11, 2012 19:49
dtuble extended
#
# dtuple.py: Database Tuple handling
#
# Written by Greg Stein. Public Domain.
# No Copyright, no Rights Reserved, and no Warranties.
#
# This module is maintained by Greg and is available at:
# http://www.lyra.org/greg/python/dtuple.py
#
# Some discussion/usage of this module can be found at:
@robotamer
robotamer / README.markdown
Created January 15, 2012 20:15
A Python module for astronomical calculations

I found this berried online, and figured a gist would be a good place for it.

HowTo

here is a quick howto: I am assuming ~/py/lib as the directory in this example

cd ~/py/lib

git clone git://gist.github.com/1617045.git sidereal

@robotamer
robotamer / msg.php
Created June 27, 2012 23:16
A messanger for the Laravel Framework
<?php
class Msg {
public static $msgss = array();
/**
* Add a message to the message array (adds to the user's session)
* @param string $type You can have several types of messages, these are class names for Bootstrap's messaging classes, usually, info, error, success, warning
* @param string $message The message you want to add to the list
@robotamer
robotamer / 1test.php
Created July 1, 2012 07:08
SplClassLoader Implementation
<?php
# Adds your library to the beginning of the php include path
addInclude('~/code/libs', FALSE);
$loader = new SplClassLoader();
# adds the php include path to the class
$loader->setIncludePathLookup(true);
$loader->add('Zend');
@robotamer
robotamer / get_php_files_in_dir.php
Created July 13, 2012 20:26
Get php files in dir with recursive lambda callback function
<?php
/**
*
* @param string $dir
* @return array
*/
function get_php_files_in_dir($dir)
{
$bin = array ();