Skip to content

Instantly share code, notes, and snippets.

View orther's full-sized avatar
🏠
Working from home

Brandon Orther orther

🏠
Working from home
View GitHub Profile
var details = document.getElementById("submission-details");
pureForm().addForm("details_form")
.addField("first_name", {type: "string", name: "First Name", validators: {
"min": {"min": 3, "error": "%field_name% must be at least %min% characters long."},
"max": {"max": 30, "error": "%field_name% must be less than %max% characters long."}
},
onValid: function (field_value) {
details.innerHTML += "<li>Sweet name: " + field_value + "</li>";
}
<?php
$a = (object) array(
"name" => "Brandon",
"age" => 29,
);
echo $a->name;
# ------
<?php
$xml_source = <<<EOF
<BackupSets>
<BackupSet ID="1267529212700" >
<BackupJob ID="2010-03-02-12-27-18" />
<BackupJob ID="2010-03-02-12-29-00" />
<BackupJob ID="2010-03-11-16-08-40" />
<BackupJob ID="2010-03-18-16-03-59" />
<BackupJob ID="2010-03-25-10-40-47" />
<?php
$find_me = 'fds';
$s1 = 'asd fds gfd hg';
$s2 = 'yj5 werg 3g rth';
$a1 = explode(' ', $s1);
$a2 = explode(' ', $s2);
$token = array_search($find_me, $a1);
import tango.io.Console;
import tango.util.container.HashMap;
import Integer = tango.text.convert.Integer;
void main()
{
Cout ("How big is that dong bro?").newline;
Cout ("Lets get some length bro, in inches please: ");
char[] length = Cin.get;
<?php
class Test {
function call ($method_name) {
// echo $method_name;
$this->{"call_".$method_name}();
Testing gist
@orther
orther / window_buffer_swap.vim
Created April 5, 2011 23:13
Vim script to allow you to swap window buffers easily
" Swap window buffers.
function! SwapWindowBuffers()
if !exists("g:markedWinNum")
" set window marked for swap
let g:markedWinNum = winnr()
:echo "window marked for swap"
else
" mark destination
let curNum = winnr()
let curBuf = bufnr( "%" )
-- Function: update_article_fts_index()
-- DROP FUNCTION update_article_fts_index();
CREATE OR REPLACE FUNCTION update_article_fts_index()
RETURNS trigger AS
$BODY$
BEGIN
-- Update the fts_index
NEW.fts_index =
@orther
orther / swap_window_buffer.vim
Created April 12, 2011 22:28
vim script that allows you to easily swap window buffers between windows(splits)
" Swap window buffers.
function! SwapWindowBuffers()
if !exists("g:markedWinNum")
" set window marked for swap
let g:markedWinNum = winnr()
:echo "window marked for swap"
else
" mark destination
let curNum = winnr()
let curBuf = bufnr( "%" )