Skip to content

Instantly share code, notes, and snippets.

View billhance's full-sized avatar

Bill Hance billhance

  • Startup
  • Los Angeles
View GitHub Profile
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class CI_Session
{
var $flash_key = 'flash'; // prefix for "flash" variables (eg. flash:new:message)
function __construct()
{
$this->_sess_run();
@billhance
billhance / gist:3036863
Created July 3, 2012 01:16 — forked from nikita2206/gist:3035134
If String Contains
<?php
if(!function_exists('if_string_contains'))
{
function if_string_contains($needle,$haystack) {
if (is_array($needle)) {
foreach ($needle as $n) {
if (strpos($haystack, $n) !== false) {
return true;

PHP Developer Interview: What you should know

###1. What’s the difference between " self " and " this " ?

Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.

Source: When to use self vs this -stackoverflow

Apr 29 14:27:44 prod-workflow1 php-fpm: pool www[5482]: PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /opt/halo-symfony/releases/2/vendor/twig/twig/lib/Twig/Node.php on line 138
Apr 29 14:27:44 prod-workflow1 php-fpm: pool www[5482]: PHP Stack trace:
Apr 29 14:27:44 prod-workflow1 php-fpm: pool www[5482]: PHP 1. {main}() /opt/halo-symfony/releases/2/workflow/web/app.php:0
Apr 29 14:27:44 prod-workflow1 php-fpm: pool www[5482]: PHP 2. AppKernel->handle() /opt/halo-symfony/releases/2/workflow/web/app.php:29
Apr 29 14:27:44 prod-workflow1 php-fpm: pool www[5482]: PHP 3. Symfony\Component\HttpKernel\Kernel->handle() /opt/halo-symfony/releases/2/workflow/app/AppKernel.php:64
Apr 29 14:27:44 prod-workflow1 php-fpm: pool www[5482]: PHP 4. Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle() /opt/halo-symfony/releases/2/workflow/app/bootstrap.php.cache:2245
Apr 29 14:27:44 prod-workflow1 php-fpm: pool www[5482]: PHP 5. Symfony\Component\HttpKe
@billhance
billhance / .gitignore
Last active August 29, 2015 14:20 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@billhance
billhance / .gitconfig
Last active August 29, 2015 14:26 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@billhance
billhance / Mac Dev Setup.md
Last active August 28, 2015 04:58 — forked from ogrrd/Mac Dev Setup.md
Installing nginx, PHP and MySQL on OS X Mavericks

Installing a Web Developer setup on OS X Mavericks

Install Command Line Tools

This is a requirement for brew in the next step. You can install XCode and then install Command Line Tools through the XCode preferences, or you can install just the Command Line Tools.

Install Command Line Tools

$ xcode-select --install
@billhance
billhance / getchildren
Created April 12, 2016 07:32 — forked from avknor/getchildren
Doctrine2 get all the child records from adjacency list.
public function getSubOrgsForTranspnakl(Entity $topitem)
{
$childrenArray = array();
$iterate = true;
$listOfParents = array();
$listOfParents = array_push($listOfParents, $topitem);
while ($iterate){
$q = $this
->createQueryBuilder('o')
@billhance
billhance / Deploying Sharetribe to Heroku.md
Created September 16, 2016 01:59 — forked from svallory/Deploying Sharetribe to Heroku.md
Deploying Sharetribe to Heroku

Deploying to Heroku

  1. Deploy the app to heroku following heroku normal instructions (add link to heroku help)

  2. Set heroku environment variables

    Make sure all the options in config.yml are properly set then run:

     bundle exec rake heroku:config