Skip to content

Instantly share code, notes, and snippets.

@balaclark
balaclark / gist:5698849
Created June 3, 2013 15:06
Twitter Bootstrap nested stacked tabs.
<!doctype html>
<head>
<meta charset="utf-8">
<title>test</title>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<style>
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
@balaclark
balaclark / news.css
Created January 16, 2012 12:10
Hacked News (minimal Hacker News user style for Firefox stylish addon)
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("news.ycombinator.com") {
td[bgcolor="#ff6600"] {
background-color: #efefef !important;
border-radius: 4px;
}
a[href="news"] {
sudo apt-get install dkms build-essential
@balaclark
balaclark / min.rb
Created June 18, 2010 10:50
Command line script to compress & combine javascript files using the google closure compiler. "sources" needs to be a plain text file with urls of each javascript file to compress on a new line, comments are fine.
require 'rubygems'
require 'rest_client'
sources = "sources"
output = "scripts.min.js"
output_path = (File.expand_path(File.dirname(__FILE__))) + "/" + output
sources_path = (File.expand_path(File.dirname(__FILE__))) + "/" + sources
# TODO: only open file if no errors, maybe save a tmp file, then copy it over the real one?
@balaclark
balaclark / smugmug.user.js
Last active August 29, 2015 14:25
Hacky way to download all items from within a smugmug gallery
downloadImages()
function downloadImages () {
var nextBtn = document.querySelector('.sm-gallery-image-pagination [data-value="right"]')
var current = -1
var total = 0
download(function () {
var index = document.querySelector('.sm-gallery-image-totals').textContent.split('/')
current = parseInt(index[0], 10)
function spy() {
var called = false
, args = null
function spyFn() {
called = true
args = Array.prototype.slice.call(arguments)
}
spyFn.calledWith = function calledWith() {
{
"atomic_save": false,
"color_scheme": "Packages/User/darkula (SL).tmTheme",
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_GB.dic",
"ensure_newline_at_eof_on_save": true,
"font_size": 13,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":