Skip to content

Instantly share code, notes, and snippets.

View mCzolko's full-sized avatar

Michael Czolko mCzolko

View GitHub Profile
@mCzolko
mCzolko / undoable.js
Created October 23, 2018 15:12
Redux Immutable Undo with diffs instead of saving whole state.
import { Map, List } from 'immutable';
const diff = require('immutablediff');
const patch = require('immutablepatch');
export const ActionTypes = {
UNDO: 'undoable/UNDO',
REDO: 'undoable/REDO',
LOAD: 'undoable/LOAD',
CLEAR_PAST: 'undoable/CLEAR_PAST',
};
@jaysoo
jaysoo / webpack.config.js
Last active November 6, 2023 03:31
Minimum webpack config for development
// 1. npm init
// 2. npm install --save webpack webpack-dev-server babel-loader babel-preset-es2015
// 3. mkdir dist && touch index.html
// 4. Include `<script src="/bundle.js"></script>` inside index.html
// 5. mkdir src && touch src/index.js
// 6. Add some code to index.js (e.g. `console.log('Hello, World!'))
// 7. npm start
// 8. Browse to http://localhost:8080/dist/
const webpack = require('webpack')
@alexras
alexras / ssh-agent-snippets.sh
Created October 17, 2011 00:14
Bash snippets to automatically start and stop an ssh-agent process on login and logout
#!/bin/bash
## in .bash_profile
SSHAGENT=`which ssh-agent`
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
fi