Skip to content

Instantly share code, notes, and snippets.

View cwarden's full-sized avatar

Christian G. Warden cwarden

View GitHub Profile
@cwarden
cwarden / table.html
Created July 11, 2012 15:27 — forked from dunhamsteve/table.html
Example of a scrollable table that only renders visible rows
<html>
<style type="text/css" media="screen">
#table {
position: absolute;
top: 30px;
bottom: 0;
left: 10px;
right: 10px;
}
#header {
String soql = new al.SoqlBuilder()
.fromx('account')
.wherex(
new al.AndCondition()
.add(new al.NotCondition(new al.FieldCondition('name', 'acme')))
.add(new al.FieldCondition('ispartner', true))
)
.toSoql();
Database.query(soql);
@cwarden
cwarden / gist:2829805
Created May 29, 2012 18:08
glob expansion without quoting
$ for i in *.gz; do ls -l $i; done
ls: cannot access file: No such file or directory
ls: cannot access 1.gz: No such file or directory
$ for i in *.gz; do ls -l "$i"; done
-rw-r--r-- 1 cwarden cwarden 27 May 29 11:03 file 1.gz
@cwarden
cwarden / .vimrc
Created May 9, 2012 21:57
fix ctrl+pgup/pgdown
noremap <Esc>[5;5~ <nop>
inoremap <Esc>[5;5~ <nop>
noremap <Esc>[6;5~ <nop>
inoremap <Esc>[6;5~ <nop>
/**
* Copyright 2012, Prescreen, Inc. https://www.prescreen.com
* @author John Smart <https://twitter.com/thesmart>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
/**
* Javascript wrapper for the Google Chart API. Enables users
* to render charts from the API with a small piece of javascript.
* This is software is still in development.
* @author Bas Wenneker <b.wenneker@gmail.com>
* @website <http://www.solutoire.com>
* @date 12-11-2007
* @version 0.2 alpha.
*/
GChart = function(){
@cwarden
cwarden / .vimrc
Created May 1, 2012 22:36
convert 4-space indents to tabs and set tabstop to 3
nnoremap <leader>4t3 :set tabstop=4 noexpandtab<cr>:retab!<cr>:set tabstop=3 shiftwidth=3<cr>
# SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
# User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
# User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
# \#Num: #1
# User/#Num: mojombo#1
# User/Project#Num: mojombo/god#1
/* de-obfuscate kettle passwords */
import java.math.BigInteger;
public class Decr {
private static final int RADIX = 16;
private static final String SEED = "0933910847463829827159347601486730416058";
public static void main(String[] args) {
if (args.length!=1) {
@cwarden
cwarden / sc-dl.js
Created March 6, 2012 16:08
Bookmarklet that generates download link for a Soundcloud upload
(function(b) {
var a = b.createElement("a");
var s = b.createElement("span");
s.innerText = "Download";
a.appendChild(s);
a.href="http://media.soundcloud.com/stream/"+b.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1];
a.setAttribute("class", "pl-button");
a.setAttribute("style", "background-image: url(http://soundcloud.com/images/icons_mini.png?unicorn26); background-repeat: no-repeat; padding-left: 18px; background-position: -77px -236px;");
a.download = b.querySelector("em").innerText+".mp3";
b.querySelector(".primary").appendChild(a);