Skip to content

Instantly share code, notes, and snippets.

@stonehippo
stonehippo / bcat.sh
Created March 21, 2011 12:38
Setting up bcat as the default man pager
# put this is in one of your startup scripts
export MANPAGER='col -b |bcat'
@stonehippo
stonehippo / adding-HA-hack-to-all-children.css
Created March 8, 2012 01:52
Adding Webkit native scrolling to an element
.scrolling-element-class * {
-webkit-transform: translate3d(0,0,0);
}
@stonehippo
stonehippo / breakpoint-example.html
Created April 3, 2012 19:51
Targeting tablets with media queries, but not tripping those queries on the desktop
<!-- The breakpoint widths below are from a specific client project and probably should be moved to standard 320/460/768 breakpoints in other usage -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<style>
body {color: #333; background-color: #eee; font-family: 'Georgia';}
.breakpoints > div { display: none; text-indent: 3em;}
@media screen and (max-width: 653px) {
@stonehippo
stonehippo / external.js
Created April 5, 2012 18:08
Invoking an inline Javascript that has a dependency on an deferred external lib
// If defer is working, this won't execute until the page has loaded
console.log('starting external...');
// Put in a something that takes some time, to simulate a large library load
for (var really_big_number = 10000000;really_big_number--;) {
really_big_number;
}
External = {
'wow': function() {
console.log('Wowsers!');
@stonehippo
stonehippo / gist:2344029
Created April 9, 2012 14:54
Prevent UIWebview "rubber band" scrolling in Phonegap apps on iOS
/*
Inserting the following into application:didFinishLaunchingWithOptions: in
the AppDelegate.m of your app will prevent the parent UIWebview for scrolling
with the "rubber band" bouncing effect, which can make the app feel more native.
*/
// Prevent the webview rubber-banding behavior (but allow other stuff to scroll)
[[[self.viewController.webView subviews] lastObject] setScrollEnabled:NO];
@stonehippo
stonehippo / index.html
Created January 12, 2013 03:18
A simple example of jQuery event binding (in this case, click events on some divs). For my brother.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<style>
div[class^='block-'] {
height: 10em;
width: 10em;
position: absolute;
@stonehippo
stonehippo / remote_rpi.md
Last active December 21, 2017 01:16
Getting a Raspberry Pi set up for x11vnc and Bonjour (mDNS) access

Getting my Raspberry Pi set up

Getting on the network

Before the rest of this gist is useful, you've got to get your Raspberry Pi on the network. I followed the information from the Adafruint Learning System Raspberry Pi tutorials, which can be found at http://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup.

Couple of additional network setup notes

The two files that are most important are

@stonehippo
stonehippo / RPi-Dashing-howto.md
Last active October 6, 2021 13:52
Setting up a Raspberry Pi as a dashboard server with Dashing

Setting up a Raspberry Pi as a dashboard server with Dashing

Why the heck did I do this?

I wanted to set up one of my Raspberry Pi's as a data dashboard, pushing sensor data to a web interface that's easy to digest. I decided to use Shopify's Dashing framework. Dashing is based on Sinatra, and is pretty lightweight.

Dashing does require Ruby 1.9.3 to run. In addition, it makes use of the execjs gem, which needs to have a working Javascript interpreter available. Originally, I tried to get therubyracer working, but decided to switch over to Node.js when I ran into roadblocks compiling V8.

One warning: The RPi is a very slow system compared with modern multi-core x86-style systems. It's pretty robust, but compiling all this complex software taxes the system quite a bit. Expect that it's going to take at least half a day to get everything going.

@stonehippo
stonehippo / mobile-monitoring-and-analytics.md
Last active December 19, 2015 04:59
A list of mobile monitoring and analytics providers
@stonehippo
stonehippo / cloud_hosting_providers.md
Created July 12, 2013 15:02
Cloud server hosting providers