Skip to content

Instantly share code, notes, and snippets.

@bikefighter
bikefighter / folders.js
Created August 15, 2016 19:25
sample React actions
import { path } from 'path';
import { glob } from 'glob';
import { push } from 'react-router-redux';
export const INCREMENT_CURSOR = 'INCREMENT_CURSOR';
export const DECREMENT_CURSOR = 'DECREMENT_CURSOR';
export const SET_PATH = 'SET_PATH';
export const ADD_ALBUM = 'ADD_ALBUM';
import fs from 'fs';
@bikefighter
bikefighter / settings.js
Created August 15, 2016 19:13
sample Electron code load for storing a filesystem path in LocalStorage
import storage from 'electron-json-storage';
const remote = require('electron').remote;
const dialog = remote.require('dialog');
export default class Settings {
constructor() {
this.pathKey = 'imagesFolder'
}
resetLocalStorage() {
@bikefighter
bikefighter / MapApp.js
Created August 15, 2016 19:05
sample React code
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import MapFrame from './MapFrame';
import NavBar from './NavBar';
import PostListFrame from './PostListFrame';
import PostViewFrame from './PostViewFrame';
import { fetchAllPosts, queryForBounds, selectPost, unselectPost } from '../actions';
export default class MapApp extends Component {
componentDidMount() {
@bikefighter
bikefighter / docker_snippets.md
Last active July 20, 2016 20:51
Docker Snippets

Docker Snippets

Remove all stopped containers

$ docker rm $(docker ps -a -q)

Remove all the untagged (<none>) images.

$ docker rmi $(docker images -q --filter "dangling=true")

Keybase proof

I hereby claim:

  • I am bikefighter on github.
  • I am bikefighter (https://keybase.io/bikefighter) on keybase.
  • I have a public key whose fingerprint is B796 DBA8 E6D2 4590 13BE DBFF BB67 5AA8 3BED BA11

To claim this, I am signing this object:

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your neelids and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@bikefighter
bikefighter / boostrap.sh
Last active August 29, 2015 13:56
bootstrap chef
#!/usr/bin/env bash
#fail on failures :)
set -e
apt-get -y update
# Install dependencies
apt-get -y install build-essential git-core curl libxml2-dev libxslt1-dev libreadline-dev libyaml-dev libcurl4-openssl-dev libncurses5-dev libgdbm-dev libffi-dev sqlite3 libsqlite3-dev
# Install Ruby 2.1.0 from source
@bikefighter
bikefighter / JavaScript MD5 Library - Gravatar
Created December 12, 2013 16:32
JavaScript MD5 Library Useful for fetching a gravatar image.
// Chris Coyier's MD5 Library
// http://css-tricks.com/snippets/javascript/javascript-md5/
var MD5 = function (string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
}
function AddUnsigned(lX,lY) {
var lX4,lY4,lX8,lY8,lResult;
@bikefighter
bikefighter / SublimeLinter.sublime-settings
Last active December 17, 2015 10:09
SublimeLinter.sublime-settings
{
"sublimelinter_executable_map":
{
// setting to current output of "which ruby"
"ruby": "/Users/username/.rvm/rubies/ruby-1.9.3-p392/bin/ruby"
}
}