Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Brekken abrkn

View GitHub Profile
@colingourlay
colingourlay / app.jsx
Created Feb 26, 2014
Using react-router-component to drive the routing of a Cordova app (while still working as a web app).
View app.jsx
function init() {
var HomePage = React.createClass({
render: function() {
return <div>Home</div>;
}
});
var NotFoundPage = React.createClass({
render: function() {
@simenbrekken
simenbrekken / example.js
Last active Aug 29, 2015
Simple RegExp-based Router
View example.js
// "Routes"
function Home() {
console.log('Home')
}
function Products(params) {
console.log(params.category, 'products')
}
function ProductDetails(params) {
@simenbrekken
simenbrekken / DataManifestMixin.js
Created Mar 21, 2014
React Store + DataManifest Prototype
View DataManifestMixin.js
'use strict';
var rsvp = require('rsvp'),
lodash = require('lodash'),
invariant = require('react/lib/invariant')
function resolve(resource) {
if (resource instanceof rsvp.Promise) {
return resource
} else if (lodash.isArray(resource)) {
View actions_referred.js
var Constants = require('../constants')
exports.query = function() {
this.dispatch(Constants.Referred.QUERY)
api.call('v1/referred')
.then(function(data) {
this.dispatch(Constants.Referred.QUERY_COMPLETED, data)
}.bind(this), function(err) {
this.dispatch(Constants.Referred.QUERY_FAILED, {
@matiu
matiu / gist:3305c42b341916fb7afc
Last active Aug 29, 2015
Copay: Remove transaction proposals
View gist:3305c42b341916fb7afc

Remove TxProposals

View iojs-1.0.4.ebuild
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
PYTHON_COMPAT=( python2_{6,7} )
MY_PV="v${PV}"
MY_P="${PN}-${MY_PV}"
@zelig
zelig / gist:adcbb8cd4e9c8259327c
Last active Aug 29, 2015
local ethereum cluster
View gist:adcbb8cd4e9c8259327c
# !/bin/bash
# bash cluster <cluster_root> <number_of_clusters> <network_id> <runid> <local_IP> [[params]...]
# sets up a local ethereum network cluster of nodes
# - <n> is the number of clusters
# - <root> is the root directory for the cluster, the nodes are set up
# with datadir `<root>/00`, `<root>/01`, ...
# - new accounts are created for each node
# - they launch on port 30300, 30301, ...
# - they star rpc on port 8100, 8101, ...
@simenbrekken
simenbrekken / CategoryStore.js
Last active Aug 29, 2015
Relay-style higher-order React components backed by Reflux
View CategoryStore.js
var Reflux = require('reflux')
var axios = require('axios')
var CategoryStore = Reflux.createStore({
init: function() {
this.items = null
},
list: function() {
var items = this.items
@abrkn
abrkn / gist:4170859
Created Nov 29, 2012
Offline wallets
View gist:4170859
1GiX5QLSqe8GKBH4bW97xK1H1JGfMmdJuT
SPENT
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.17 (MingW32)
hQEMA8c3OfKU6OsOAQgAq5sMPnbdh8MaHgEUYYQ0vBpKdT3ShI3SjMfT1H5s0hIW
GshQZgbwrSOM5FCqas9krBxxEkxX+MBUfqACC2LwIno5lwjvfR6/DliOEBrUg4Rj
4xgz2wR0fLZbV6RX4I2+u2vvzi5qiIbXKfAELxfFkD/5DniiW4zinq8fjrMZquRC
KkzxXC3qU1YEiR8oZya/AdRl+pmfvweXruE4+JXbmASIvV0uHjsFafoZa17DgwFK
@simenbrekken
simenbrekken / SublimeLinter.sublime-settings
Last active Dec 17, 2015
SublimeLinter configuration
View SublimeLinter.sublime-settings
{
"jshint_options": {
"browser": true, // This option defines globals exposed by modern browsers: all the way from good ol' document and navigator to the HTML5 FileReader and other new developments in the browser world.
"devel": true, // This option defines globals that are usually used for logging poor-man's debugging: console, alert, etc.
"expr": true, // This option suppresses warnings about the use of expressions where normally you would expect to see assignments or function calls. Most of the time, such code is a typo. However, it is not forbidden by the spec and that's why this warning is optional.
"globals": {
"_": false // I usually include lodash/underscore in all my projects so feel free to remove this
},
"indent": 4, // This option enforces specific tab width for your code.
"jquery": true, // This option defines globals exposed by the jQuery JavaScript library.