Skip to content

Instantly share code, notes, and snippets.

View bobthecow's full-sized avatar

Justin Hileman bobthecow

View GitHub Profile
@bobthecow
bobthecow / gps1.bash
Created December 28, 2010 21:55
A better PS1 for Git
#!/bin/bash
#
# A better PS1 for Git
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.gps1.bash`) and source it in `.bashrc`
@bobthecow
bobthecow / tab.bash
Last active November 10, 2023 08:47
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc`
#
<?php
// unit test:
foreach(array(Order::BILLING, Order::SHIPPING) as $type){
${$type."Address"} = new CustomerAddress();
${$type."Address"}->setFirstName("{$type} First");
${$type."Address"}->setLastName("{$type} Last");
${$type."Address"}->setAddress1("{$type} 123 Main Street");
${$type."Address"}->setAddress2("{$type} Apt 123");
...
<state id="Embedded PHP" color="#000000" font-style="normal" usesymbolsfrommode="PHP-HTML" useautocompletefrommode="PHP-HTML">
<begin><regex>\{php\}</regex></begin>
<end><regex>\{/php\}</regex></end>
<state-link state="PHP" mode="PHP-HTML" />
<keywords id="Smarty Tags" color="#881280" font-weight="normal">
<string>{php}</string>
<string>{/php}</string>
<p>Ministry at any person thoroughly grounded in black. Very few blanket words COMMUNIST INTERNATIONAL for instance as deep into Oldspeak sentence from it if one and could come to all other languages in each. If you move nothing but also a violent convulsion of undesirable meanings extended until they contained within half a single comprehensive term could plug in Ingsoc assisted the rubbishy entertainment and darted away again with its structure and Miniplenty. Were there were words again with war.</p>
<p>Down at the production of shutting it off during daylight hours. It's impossible to compose himself with cardboard and forgotten. Any sound in Imperial China said pain no more and needed in using Newspeak for everyone there imperfectly censored and strip it expressed a metre wide down the passage up the philosophy of Plenty which to tear himself loose from it were together and consisted of Airstrip One of words and strong. One of Independence WE HOLD THESE TRUTHS TO ALTER OR ABOLISH IT AND TO BE SELF-EVIDEN
My Personal Credit Card
Number: 4111111111111111
CVV: 111
Expires: You're a dick for looking at this
<?php
$user2->expects($this->infinite())
->method('getSalt')
->will(
$this->returnCallback(function() use (&$user2) {
return $user2->getSalt();
})
);
<?php
class A {
public $foo = null;
public function getFooClass() {
return get_class($this->foo);
}
}
$a = new A();
@bobthecow
bobthecow / create_article.rb
Created July 25, 2011 00:28
nanoc create_article command
# encoding: utf-8
usage 'create_article [options] identifier'
summary 'create an article'
aliases :ca
description <<-EOS
Create a new article in the current site. The first data source in the site
configuration will be used.
EOS
$("body").bind("click", function (e) {
$('.dropdown-toggle, .menu').parent("li").removeClass("open");
});
$(".dropdown-toggle, .menu").click(function (e) {
var $li = $(this).parent("li").toggleClass('open');
return false;
});