Skip to content

Instantly share code, notes, and snippets.

@anyong
anyong / powbox-example.js
Created February 28, 2018 00:57
Powbox usage example
const IOTA = require('iota.lib.js')
const remoteCurl = require('@iota/curl-remote')
// IOTA node and powbox are separate servers
const provider = 'https://nodes.testnet.iota.org:443'
const powbox = 'https://powbox.testnet.iota.org'
// Create an IOTA object as usual
const iota = new IOTA({ provider })
@anyong
anyong / keybase.md
Created January 2, 2018 03:40
keybase.md

Keybase proof

I hereby claim:

  • I am anyong on github.
  • I am anyong (https://keybase.io/anyong) on keybase.
  • I have a public key ASAzewIlBmzCaf0XhRkiPy_QnEXYwWKioMZbo9e4C42FEwo

To claim this, I am signing this object:

@anyong
anyong / bookshelf-pagination-plugin.js
Last active March 31, 2016 08:18
Bookshelf pagination plugin demo
import Promise from 'bluebird';
/**
* The default pagination options, these can be overridden
* by the user by passing an options object as the first argument
* to the Model#pagination call. The 'sort' column here can
* refer to any column in the Model's table or another table using
* the standard 'table.column' notation.
*/
const defaultOptions = {
@anyong
anyong / splitpages.js
Created August 23, 2015 17:02
Split Adobe PDF pages down the middle or with an offset, and exclude variable number of pages from the front of doc.
cut = function(offset, start)
{
start = start || 1;
offset = offset || 0;
// create a new document
app.beginPriv();
var newDoc = app.newDoc();
app.endPriv();
// get the filename of our current file
@anyong
anyong / ActionTypes.js
Last active January 22, 2016 21:32
React Redux Router
export const LOGIN_REQUEST = 'LOGIN_REQUEST';
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
export const LOGIN_FAILURE = 'LOGIN_FAILURE';
export const LOGOUT = 'LOGOUT';
{
"title": "Welcome to My Site"
}
@anyong
anyong / App.jsx
Last active August 29, 2015 14:20
var React = require('react'),
Flocks = require('flocks.js'),
Router = require('react-router'),
AppRoutes = require('./AppRoutes');
var App = Flocks.createClass({
render () {return <div id="router"></div>;}
});
var Config = { target: document.getElementById('app'), control: App};
jest.dontMock('../TestComponent');
describe('test component', function() {
var TestComponent = require('../TestComponent');
});