This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// My attempt to make David Walsh's xmlToJson function work | |
// with libxmltojs. This reproduces the document tree but not | |
// the text inside in each node. There is a lot of data in these | |
// documents we are not using... I think we should stick to the | |
// xpath queries. | |
// Changes XML to JSON | |
function xmlToJson (xml) { | |
// Create the return object | |
var obj = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ { title: 'Makin\' It Singles', | |
name: 'Upper-scale urban singles.', | |
description: 'Pre-middle-age to middle-age singles with upper-scale incomes. May or may not own their own home. Most have college educations and are employed in mid-management professions.' }, | |
{ title: 'Aspiring Urbanites', | |
name: 'Urban singles with moderate income.', | |
description: 'Low- to middle-income singles over a wide age range. Some have a college education. They work in a variety of occupations, including some management-level positions.' }, | |
{ title: 'Bright Lights, Big City', | |
name: 'Very mobile singles living in the city.', | |
description: 'Singles ranging in age from early 20s to mid-40s who have moved to an urban setting. Most rent their apartment or condo. Some have a college education and work in services and the professional sector.' } ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
now := time.Now() | |
oneMonthAgo := time.Unix(now.Unix() - (60 * 60 * 24 * 30), 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run in mock production mode with docker | |
dockerEnv() { | |
mkdir -p images; | |
printf "Starting the mongodb container...\n"; | |
docker run -d --name="spacedb" beshippable/dbbase; | |
printf "Starting the application container...\n"; | |
docker run -v $(pwd):/app -p 8080:8080 -v $(pwd)/images:/img \ | |
--name="spacecam" -e NODE_ENV=prod --link spacedb:db \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = Runner; | |
function Runner() { | |
this.stack = []; | |
this.passed = 0; | |
this.failed = 0; | |
} | |
Runner.prototype.it = function (msg, test) { | |
this.stack.push(new Test(msg, test)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implements fig syntax. | |
package main | |
import ( | |
"gopkg.in/yaml.v1" | |
"io/ioutil" | |
"log" | |
) | |
var metaConfig MetaConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.hashCode = function(){ | |
var hash = 0; | |
if (this.length == 0) return hash; | |
for (i = 0; i < this.length; i++) { | |
char = this.charCodeAt(i); | |
hash = ((hash<<5)-hash)+char; | |
hash = hash & hash; // Convert to 32bit integer | |
} | |
return hash; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# conky configuration | |
# | |
# The list of variables has been removed from this file in favour | |
# of keeping the documentation more maintainable. | |
# Check http://conky.sf.net for an up-to-date-list. | |
# | |
# For ideas about how to modify conky, please see: | |
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/ | |
# | |
# For help with conky, please see: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude"> | |
<resistance> | |
<strength>10</strength> | |
<screen_edge_strength>20</screen_edge_strength> | |
</resistance> | |
<focus> | |
<focusNew>yes</focusNew> | |
<!-- always try to focus new windows when they appear. other rules do | |
apply --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------------------------------------------- | |
# TINT2 CONFIG FILE | |
#--------------------------------------------- | |
# For more information about tint2, see: | |
# http://code.google.com/p/tint2/wiki/Welcome | |
# | |
# For more config file examples, see: | |
# http://crunchbanglinux.org/forums/topic/3232/my-tint2-config/ | |
# Background definitions |