Skip to content

Instantly share code, notes, and snippets.

View ketema's full-sized avatar
💭
Coding….

Ketema Harris ketema

💭
Coding….
View GitHub Profile
@ketema
ketema / gist:4589228
Last active December 11, 2015 10:48
git alias for command line visual graph
alias.lol=log --graph --decorate --pretty=oneline --abbrev-commit
alias.lola=log --graph --decorate --pretty=oneline --abbrev-commit --all
@ketema
ketema / A.php
Created April 16, 2012 23:32
Simple Pg inheritance
<?php
namespace app\models;
class A extends \lithium\data\Model
{
protected $_meta = array(
'source' => 'a',
);
@ketema
ketema / Model::config Learning.txt
Created March 30, 2012 00:08
Learning li3...Model::config
OH MY FN GOD! This took for ever so I will memorialize my learning
experience. GOAL: I wanted the element that would display an input form
for Customers to be able to render its form fields dynamically. In lieu
of writing some whole new Form object I made some observations and came
to a compromise. First the observations: 1) Mongo based Models do not
have a schema by default. You have a black magic option to use a
callback in the connection definition to dynamically load the schema,
but that means you actually have to store the schema in mongo for each
mongo based Model. 2) All li3 objects have an __init method ( even
static ones where its static) in which you can do constructor type
RewriteEngine On
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 9
RewriteCond %{HTTP_HOST} ^(?:www)?(?:\.)?(.+)$
RewriteCond /var/www/%1/pub -d
RewriteRule ^/?(.*)$ /var/www/%1/pub/$1
@ketema
ketema / cyclo_comparison.txt
Created August 17, 2011 03:28
phploc comparison of some PHP 5.3+ only frameworks
fuel/
=====
Directories: 75
Files: 303
Lines of Code (LOC): 60989
Cyclomatic Complexity / Lines of Code: 0.15
Comment Lines of Code (CLOC): 23831
Non-Comment Lines of Code (NCLOC): 37158
@ketema
ketema / strips.py
Created July 29, 2011 15:40
Orlando Python Meetup Group 7/28/2011
#!/usr/bin/env python2.7
import unittest
import datetime
import lxml.html
from xml.etree import ElementTree
class StripTest(unittest.TestCase):
def setUp ( self ):
self.base_url = 'http://dilbert.com/'