Skip to content

Instantly share code, notes, and snippets.

void setup(){
size(500,500,P3D);
smooth(8);
}
float f(int i, int j, float q){
return(q*(noise(.2*(i+400-.05*frameCount),.2*(j+90))-.5));
}
float s;
@adamkdean
adamkdean / .bashrc
Last active September 3, 2015 14:16
Organise your bash history
# Organise your bash history, thanks to:
# https://twitter.com/michaelhoffman/status/639178145673932800
mkdir -p "${HOME}/.history/$(date -u +%Y/%m)"
export HISTFILE="${HOME}/.history/$(date -u +%Y/%m/%d.%H.%M.%S)_${HOSTNAME}_$$"
@lance
lance / bootstrap-project.sh
Last active December 28, 2015 10:29
Bootstrap a project with tmux
#!/bin/sh
if [ -z "$1" ] ; then
echo "usage: $0 <projectname> [/path/to/project]"
exit 1
fi
MYPROJECT=$1
# Setup some variables needed for bootstrapping the environment
if [ -z "$2" ] ; then
@acdlite
acdlite / pureRenderMixin.js
Last active July 17, 2019 09:29
Pure Render Mixin in ES6
function pureRenderMixin(Component) {
Component.prototype.shouldComponentUpdate(nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
return Component;
}
class MyComponent extends React.Component {}
@tlrobinson
tlrobinson / redux-devtools-separate-window.js
Last active August 20, 2019 23:54
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
// give it a name so it reuses the same window
var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
// reload in case it's reusing the same window with the old content
win.location.reload();
// wait a little bit for it to reload, then render
setTimeout(function() {
React.render(
<DebugPanel top right bottom left >
@romainl
romainl / _rnb.md
Last active August 12, 2021 21:56
RNB, a Vim colorscheme template
@HenrikJoreteg
HenrikJoreteg / README.md
Last active September 20, 2021 01:36
Minimalist routing in Redux

Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.

Instead, with this approch, your app's current pathname is just another piece of state, just like anything else.

This also means that when doing server-side rendering of a redux app, you can just do:

var app = require('your/redux/app')
var React = require('react')
@bjorgvino
bjorgvino / yosemite ntfs read+write.txt
Last active December 2, 2021 03:58
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@entrity
entrity / AVR-makefile-base.mk
Last active December 5, 2022 17:35
An extensible Makefile for AVRs which makes use of the Arduino core and (optionally) Arduino libraries.
### MARKHAM'S NOTES:
# This Makefile includes the Arduino core sources. (Set ARDDIR here:)
ARDDIR = /d/arduino
# You should build a tiny Makefile for each of your projects and just declare a few
# things in it, then include this Makefile in it. Your Makefile should be in the same
# directory as your TARGET file (see below).
#
# Exemplia gratia:
@tlrobinson
tlrobinson / post-receive
Last active December 7, 2022 08:15
Super simple git post-receive hook for Node.js + nvm + npm + node-foreman + init (Ubuntu) deployment
#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f