Skip to content

Instantly share code, notes, and snippets.

Christian Howe coderarity

Block or report user

Report or block coderarity

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View foo.js
// (c) 2013 coderarity is a boss, inc
function Foo (id) {
var _this = this;
if (id) {
db.redis.get(id, function(err, res) {
var obj = JSON.parse(res);
for (property in obj) {
if (property === 'date_created') {
_this[property] = new Date(obj[property]);
} else {
@coderarity
coderarity / gist:5085896
Created Mar 4, 2013
this is a messy way to find a git file from the depths of git! change the grep to be some way to identify your file
View gist:5085896
git prune -n > tmp12312661.txt
sed -i 's/ blob//g' tmp12312661.txt
while read line
do
git cat-file -p $line | grep "require('simplesmtp')"
if [ "$?" == "0" ]; then echo $line; fi
done < tmp12312661.txt
rm tmp12312661.txt
@coderarity
coderarity / gist:4617985
Created Jan 24, 2013
what's wrong with this?
View gist:4617985
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#define ERROR_VAL -1
#define SUCCESS_VAL 0
#define ERROR (err) { errno = (err); }
View gist:4576240
var express = require('express'),
wine = require('./routes/wines');
var app = express();
app.configure(function () {
app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
app.use(express.bodyParser());
app.use(express.static(__dirname));
});
@coderarity
coderarity / gist:4425929
Created Jan 1, 2013
Awesome lack of Java on android! I am pleased.
View gist:4425929
// from http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html
void android_main(struct android_app* state) {
// Make sure glue isn't stripped.
app_dummy();
// loop waiting for stuff to do.
while (1) {
// Read all pending events.
int ident;
@coderarity
coderarity / gist:4409172
Created Dec 29, 2012
mtpfs crashes with Nexus 7 after trying to copy some books over
View gist:4409172
Dec 29 15:21:31 twilight sudo[1324]: coderarity : TTY=pts/0 ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mtpfs -o allow_other /media/Nexus7/
Dec 29 15:21:31 twilight sudo[1324]: pam_unix(sudo:session): session opened for user root by coderarity(uid=0)
Dec 29 15:21:40 twilight sudo[1324]: pam_unix(sudo:session): session closed for user root
Dec 29 15:22:11 twilight kernel: mtpfs[1330]: segfault at 0 ip 0804c9b1 sp b68fefe0 error 4 in mtpfs[8048000+7000]
Dec 29 15:22:11 twilight systemd-coredump[1373]: Process 1328 (mtpfs) dumped core.
@coderarity
coderarity / gist:4394690
Created Dec 28, 2012
simple example of how to update Nodejitsu domains field without adding it to your package.json
View gist:4394690
var http = require('http')
var nj = require('nodejitsu-api')
var client = nj.createClient({
username: 'coderarity',
password: '*****',
remoteUri: 'https://api.nodejitsu.com'
})
var appname = 'dns-test'
@coderarity
coderarity / gist:4361459
Created Dec 22, 2012
Tower of Heaven level - play at https://www.newgrounds.com/portal/view/544332 click load custom level
View gist:4361459
1c0c100001080100000000000000000004021e0602110702110802110902120a02120b02110c02110303030403030503030603030703030803030903030a03030b03030c03030404080504080604080704080804080904080a04080b04080c04080f05060408070c08071108050409030c0903000a1d010a07110a07000b03010b03080b05090b05100b03110b03|jaws|coderarity||
View curlPass
ofshard@whyink:~/346321 (master) $ curl -X POST \ -H "Content-type: application/json" \ --data "{ \"credentials\": githubUser:githubPassword }" \ https://nodejitsuUse
r:nodejitsuPass@webhooks.nodejitsu.com/1/auth/github
curl: (6) Couldn't resolve host ' -H'
View gist:4050384
{
"name": "nko3-intergrupo-mobile",
"version": "0.0.0-6",
"description": "Intergrupo Mobile",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"repository": {
"type": "git",
You can’t perform that action at this time.