Skip to content

Instantly share code, notes, and snippets.

View unusualbob's full-sized avatar

Rob Riddle unusualbob

View GitHub Profile
@unusualbob
unusualbob / imageExtractor.js
Last active April 8, 2017 04:38
Script to extract images from hex photo recall export file
'use strict';
var fs = require('fs');
/*
Information about why this exists can be found here:
https://robriddle.io/extracting-images-from-photorecall-deluxe-files/
*/
var stringHex = fs.createReadStream('./myOutputFile.txt');
var lastIndex = 0;
@unusualbob
unusualbob / imageExtractor.js
Created April 8, 2017 04:37
Script to extract images from hex photo recall export file
'use strict';
var fs = require('fs');
var stringHex = fs.createReadStream('./myOutputFile.txt');
var lastIndex = 0;
var imageBuffer = new Buffer('');
var dirname = process.argv[2];
if (!dirname) {
return console.log('Usage: ./imageExtractor.js <localDirectoryToExportImagesTo>');
@unusualbob
unusualbob / csvImport
Last active October 24, 2015 10:25
A quick script to import a csv from a stream
var fs = require('fs');
var csv = require('csv-stream');
var MongoClient = require('mongodb').MongoClient;
//Put the absolute path to your csv file here, example '/home/windam/file.csv'
var fileToLoad = '';
//This assumes mongo is running on the current host on default port, and that your db is called 'myDbName'
//If not then change it :)
var mongodbConnectionString = 'mongodb://127.0.0.1:27017/myDbName';
@unusualbob
unusualbob / SKD.md
Last active August 29, 2015 14:06 — forked from yemel/SKD.md

Cordova SDK

Please go to http://test.bitpay.com to create an account. After registration, depending on the kind of application you are building you may need to go through a pairing process.

Install the SDK plugin

$ cordova plugin add https://github.com/bitpay/cordova-skd.git

Generate Application Key

Use case: Generating and tracking invoices.

@unusualbob
unusualbob / gist:4288643
Created December 14, 2012 21:00
Mongoose Connection Deal
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
//Define our schema(s)
var ConfigSchema = new Schema({
name: { type: String, required: true }
, USERID: { type: String, required: true }
, ROOMID: { type: String, required: true }
});
@unusualbob
unusualbob / Fragment activity.java
Created October 18, 2012 14:07
Basic fragment stuff
public class MainActivity extends FragmentActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
mainID = this.findViewById(R.id.mainid);
mAdapter = new MainFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager) findViewById(R.id.pager);