Skip to content

Instantly share code, notes, and snippets.

@j0shua
j0shua / mongo.todo.php
Created January 3, 2011 22:16 — forked from jmhobbs/mongo.todo.php
mongo todo in php
#!/usr/bin/env php
<?php
error_reporting( E_ERROR | E_PARSE );
class ToDo {
protected $argv = array();
public function __construct ( $argv ) {
# -*- coding: utf-8 -*-
# This script is used to combine PHP source files together into one big glob.
# I wrote this so I could distribute a single file web application, but develop
# it in a sane fashion.
# Copyright (c) 2010, John M. Hobbs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@j0shua
j0shua / wordcount.html
Created March 22, 2011 13:46
Word counter in js from simonw
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Word counter</title>
<style type="text/css">
div.textareas textarea {
vertical-align: middle;
}
@j0shua
j0shua / .vimrc
Created April 8, 2011 13:29
.vimrc
set expandtab
set ts=2
set sw=2
"set foldmethod marker
set hlsearch
hi Comment ctermfg=lightgray
ab klog Kohana::log('debug',
@j0shua
j0shua / .bashrc
Created April 8, 2011 13:30
.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
#0 Reset all attributes
#1 Bright
create a module to reverse a html form into drupal form definition
to see a certain file as it was in a certain commit
git show commit:path/to/file >something
MAC clipboard is called pbcopy :
echo "blah" | pbcopy
to create an empty (bare) repo:
@j0shua
j0shua / rest_ajax_city.php
Created April 8, 2011 15:32
rest ajax city
<?php
class Controller_Rest_Ajax_City extends Controller_Rest_Ajax {
public function before() {
parent::before();
}
@j0shua
j0shua / JSLikeHTMLElement.php
Created April 27, 2011 23:56
JSLikeHTMLElement for php Readability port from http://www.keyvan.net/2010/08/php-readability/
<?php
/**
* JavaScript-like HTML DOM Element
*
* This class extends PHP's DOMElement to allow
* users to get and set the innerHTML property of
* HTML elements in the same way it's done in
* JavaScript.
*
* Example usage:
<?php
/**
* Arc90's Readability ported to PHP for FiveFilters.org
* Based on readability.js version 1.7.1 (without multi-page support)
* ------------------------------------------------------
* Original URL: http://lab.arc90.com/experiments/readability/js/readability.js
* Arc90's project URL: http://lab.arc90.com/experiments/readability/
* JS Source: http://code.google.com/p/arc90labs-readability
* Ported by: Keyvan Minoukadeh, http://www.keyvan.net
* More information: http://fivefilters.org/content-only/
@j0shua
j0shua / readability.js
Created April 28, 2011 00:07
readability js
//
if(typeof(readability) === "undefined"){
readability = {};
}
(function (readability) {
readability.baseUrl = 'https://www.readability.com';
readability.type = 'read';