Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Brekken abrkn

View GitHub Profile
@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
@taldanzig
taldanzig / osxvpnrouting.markdown
Created Jan 24, 2013
Routing tips for VPNs on OS X
View osxvpnrouting.markdown

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 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.
@simenbrekken
simenbrekken / bank-accounts.css
Last active Dec 18, 2015
State driven Stylus
View bank-accounts.css
.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 Jun 25, 2013
Various jQuery convenience plugins
View plugins.js
$.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 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)) {
@stefansundin
stefansundin / git-bundle-hook.md
Last active Apr 26, 2021 — forked from 8bitDesigner/1.md
Git post-checkout and post-merge hooks to simplify bundling and other tasks.
View git-bundle-hook.md

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
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, {