Skip to content

Instantly share code, notes, and snippets.

View nodesocket's full-sized avatar

Justin Keller nodesocket

View GitHub Profile
test("search results show", function () {
$("#marketplaces ul a:contains('Test Marketplace')").click();
$("#q").val("%").trigger('keyup');
equal($("#q").hasClass("with-results"), true);
});
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping : 7
cpu MHz : 2000.030
cache size : 20480 KB
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 2
model name : QEMU Virtual CPU version 1.2.0
stepping : 3
cpu MHz : 2299.998
cache size : 4096 KB
var start = process.argv[2];
var end = process.argv[3];
while(start < end) {
var start_string = String(start);
if(start_string === start_string.split("").reverse().join("")) {
console.log(start_string);
}
<?php
$start = $argv[1];
$end = $argv[2];
while($start < $end) {
$start_string = (string)$start;
if($start_string === strrev($start_string)) {
echo $start_string . "\n";
}
@nodesocket
nodesocket / gist:5023502
Last active December 14, 2015 03:49
## GitHub Commit Message Tricks

GitHub Commit Message Tricks

@username

References a user in a commit message.

@ryah I am working on it.

An issue id

Referene a particular issue by id.

#!/bin/bash
# @description Sync a directory to s3
# @version 1.0.0
# @date last modified 02/21/2013
#
# Commando.io
# Copyright 2013 NodeSocket, LLC.
# All Rights Reserved.
if [ "$1" == "" ]; then
<?php
require_once("classes/MongoConfiguration.php");
require_once("classes/MongoConnection.php");
while(true) {
$mongodb = MongoConnection::connect();
print_r($mongodb);
if($mongodb) {
echo "MongoDB [UP]\n";
@nodesocket
nodesocket / gist:4773126
Created February 12, 2013 20:33
MongoConnection.php
<?php
class MongoConnection {
/**
* @staticvar Resource
*/
private static $mongo_client;
private static $mongo_db;
private static $mongo_collection;
@nodesocket
nodesocket / gist:4772310
Created February 12, 2013 18:58
MongoDB Replica Set Issues
Notice: CON WARN: ismaster: the server name (10.X.X.70:27017) did not match with what we thought it'd be (mongodb2.local.my-domain.io:27017).
Notice: CON FINE: ismaster: the found replicaset name matches the expected one (rs-san-jose).
Notice: CON INFO: ismaster: set name: rs-san-jose, ismaster: 0, secondary: 1, is_arbiter: 0
Notice: CON INFO: found host: 10.X.X.70:27017
Notice: CON INFO: found host: 10.X.X.69:27017