Skip to content

Instantly share code, notes, and snippets.

View abrkn's full-sized avatar

Andreas Brekken abrkn

View GitHub Profile
@abrkn
abrkn / gist:4170859
Created November 29, 2012 18:10
Offline wallets
1GiX5QLSqe8GKBH4bW97xK1H1JGfMmdJuT
SPENT
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.17 (MingW32)
hQEMA8c3OfKU6OsOAQgAq5sMPnbdh8MaHgEUYYQ0vBpKdT3ShI3SjMfT1H5s0hIW
GshQZgbwrSOM5FCqas9krBxxEkxX+MBUfqACC2LwIno5lwjvfR6/DliOEBrUg4Rj
4xgz2wR0fLZbV6RX4I2+u2vvzi5qiIbXKfAELxfFkD/5DniiW4zinq8fjrMZquRC
KkzxXC3qU1YEiR8oZya/AdRl+pmfvweXruE4+JXbmASIvV0uHjsFafoZa17DgwFK
@taldanzig
taldanzig / osxvpnrouting.markdown
Created January 24, 2013 22:14
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@simenbrekken
simenbrekken / SublimeLinter.sublime-settings
Last active December 17, 2015 20:59
SublimeLinter configuration
{
"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.
@simenbrekken
simenbrekken / bank-accounts.css
Last active December 18, 2015 09:48
State driven Stylus
.visible-empty {
display: block;
}
.is-empty .visible-empty,
.has-empty .visible-empty {
display: none;
}
.is-empty .hidden-empty,
.has-empty .hidden-empty {
display: none;
@simenbrekken
simenbrekken / plugins.js
Created June 25, 2013 07:34
Various jQuery convenience plugins
$.fn.template = function(selector) {
return $(this).find(selector + '[data-template]').removeAttr('data-template').remove()
}
$.fn.rows = function(columns) {
var children = $(this).children().get()
while (children.length) {
var chunk = children.splice(0, columns)
$(chunk).wrapAll('<div class="row' + (chunk.length % 2 ? ' uneven' : '') + '">')
@colingourlay
colingourlay / app.jsx
Created February 26, 2014 23:58
Using react-router-component to drive the routing of a Cordova app (while still working as a web app).
function init() {
var HomePage = React.createClass({
render: function() {
return <div>Home</div>;
}
});
var NotFoundPage = React.createClass({
render: function() {
@simenbrekken
simenbrekken / example.js
Last active August 29, 2015 13:57
Simple RegExp-based Router
// "Routes"
function Home() {
console.log('Home')
}
function Products(params) {
console.log(params.category, 'products')
}
function ProductDetails(params) {
@simenbrekken
simenbrekken / DataManifestMixin.js
Created March 21, 2014 13:44
React Store + DataManifest Prototype
'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)) {
@stefansundin
stefansundin / git-bundle-hook.md
Last active February 1, 2024 06:42 — forked from 8bitDesigner/1.md
Git post-checkout and post-merge hooks to simplify bundling and other tasks.

Make bundleing and npm installing easy

These git hooks runs bundle or npm install automatically whenever you:

  • git checkout a new branch with a different Gemfile or package.json.
  • git pull a change to Gemfile or package.json.

How to install

  1. cd awesome_git_repo
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, {