Skip to content

Instantly share code, notes, and snippets.

View cgkio's full-sized avatar

Christian Kessler IV cgkio

View GitHub Profile
@cgkio
cgkio / removearrows.html
Created January 19, 2013 01:30
Remove default (right) arrow from a jQuery Mobile list view #JQM
<li data-icon="false"><a href="contact.html">Contact Us</a></li>
<!-- By default, jQuery Mobile framework adds an arrow next to every list item. To disable this, set data-icon attribute to “false” on the list item that you’d like the arrow to be removed. -->
@cgkio
cgkio / truncationjqm.css
Created January 19, 2013 01:38
Disable truncation for list items and buttons in jQuery Mobile. #JQM
/* Disable truncation for list items and buttons. If your list item or button has a long text, it will be truncated automatically by jQuery Mobile. To disable this truncation, add “white-space: normal;” to the CSS selector in question.
For example, to disable truncation for buttons: */
.ui-btn-text {
white-space: normal;
}
/* To disable truncation for list descriptions: */
@cgkio
cgkio / subnav.css
Created January 20, 2013 15:04 — forked from thomaspark/subnav.css
Sub-NavBars in Twitter Bootstrap
section {
padding-top: 60px;
}
.subnav {
margin-bottom: 60px;
width: 100%;
height: 36px;
background-color: #eeeeee; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
// Required modules.
var cradle = require('cradle');
var util = require('util');
var http = require('http');
// Config.
var config = require('./config');
// Variable to hold chunked data from Postmark.
var mailRaw = '';
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
@cgkio
cgkio / app.js
Created April 10, 2013 19:53
Parse inbound emails with Node.js, Cradle, and CouchDB
// Required modules.
var cradle = require('cradle');
var util = require('util');
var http = require('http');
// Config.
var config = require('./config');
// Variable to hold chunked data from Postmark.
var mailRaw = '';
@cgkio
cgkio / nodejs_on_pi.sh
Created September 16, 2013 17:05
Install node.js on Raspberry Pi
$ wget http://node-arm.herokuapp.com/node_latest_armhf.deb
$ sudo dpkg -i node_latest_armhf.deb
$ node -v
@cgkio
cgkio / setfullheight.js
Created September 18, 2013 02:26
Set div height to full screen
$(function() {
var window_height = $(window).height(),
content_height = window_height - 200;
$('#div').height(content_height);
});
@cgkio
cgkio / working_with_objects_in_node.js
Created September 18, 2013 02:50
working with objects in node.js
// working with objects in node.js:
// http://book.mixu.net/node/ch5.html
var questions = Object.keys(jsonScores);
questions.forEach(function (question) {
var answers = Object.keys(jsonScores[question]);
answers.forEach(function (answer) {
var value = jsonScores[question][answer];
console.log(question + ': ' + answer + ' = ' + value);
});
});