Skip to content

Instantly share code, notes, and snippets.

View raurir's full-sized avatar
♻️
Why would I set my status on source control software?

Rauri Rochford raurir

♻️
Why would I set my status on source control software?
View GitHub Profile
@raurir
raurir / HookProblem.tsx
Last active May 14, 2024 15:47
Hook problem
import { useEffect, useState } from "react";
// you can not modify this function:
const getAdvice = () => {
console.log("getAdvice");
const [advice, setAdvice] = useState("");
useEffect(() => {
const url = "https://api.adviceslip.com/advice";
@raurir
raurir / sublime.packages.md
Last active November 27, 2018 04:09
Sublime Packages + Settings

Git

github.com/kemayo/sublime-text-git

Babel

babeljs.io

Settings

@raurir
raurir / git.txt
Last active August 7, 2018 00:45
Git tips
# work log for last week on all branches
git log --author='rauri' --pretty=format:"%h - %cr - %s" --all
# search for first case of a keyword
git log -S'require("react")' -- app/coffee/app.coffee
# list all branches including remotes
git branch -al
# get usage history + for user
@raurir
raurir / block-spiral.js
Last active March 13, 2018 12:07
Block Spiral - experiment using https://github.com/spite/looper
const con = console;
import context from '../modules/context2d.js';
import easings from '../modules/easings.js';
const canvas = context.canvas;
const loopDuration = 5;
const BLOCK_SIZE = 100;
const SQUARE_WIDTH = 2900;
const PATH_STEPS = 433;
@raurir
raurir / gist:97a131159c31933067717968c1a4c436
Created August 7, 2017 03:25
Jonathan Blow on refactoring/porting
"I would paste the C++ into a new file and retype it by hand, for several reasons:
1 - because it gives you a better quality resulting code
2 - it forces me to be observing at every [time], how easy it to express this thing in this other language right? Am I having problems? Are things getting better?
and then the last reason is - honestly, the code kind of needed some refactoring, even before leaving C++, so it was good to do that"
https://www.youtube.com/watch?v=De0Am_QcZiQ&feature=youtu.be&t=1206
@raurir
raurir / pleasure.html
Last active July 25, 2017 12:51
Unknown Pleasure
<canvas id="c" width="600" height="600"></canvas>
<script type="text/javascript">
/*
// c is defined by browser since canvas has id c
t=c.getContext('2d')
s=600 // square canvas size
p=80 // number of points, lines and margins!
g=(s-2*p)/p // gap between each point and line
for(i=0;i<p;i++){
Save this:
<snippet>
<content><![CDATA[con.log(${1})]]></content>
<tabTrigger>lg</tabTrigger>
<scope>source.js</scope>
<description>conlog</description>
</snippet>
as this:
@raurir
raurir / heart.js
Last active February 3, 2017 03:37 — forked from paulirish/heart.js
666
// 99% done by @rauri rochford
// http://js1k.com/2012-love/demo/1071
// rAF'd it by @paul_irish
// pentagram'd by raurir in 2017
// demo at: https://bl.ocks.org/raurir/15393091438e2024fd8c0d7bf57649a7
e = [];// trails
h = [];// heart path
O = c.width = innerWidth;
@raurir
raurir / new-machine.yml
Last active March 11, 2024 02:18
Notes for getting a new machine. Don't forget: There are always more steps than you remember!
create account
install:
1password
little snitch
dropbox
google drive
chrome
iterm2
sizeup
@raurir
raurir / shell.md
Last active March 6, 2024 04:23
shell + git + prompt

git configuration

git config --global user.name "raurir"
git config --global user.email "email"
git config --global core.editor "subl -n -w"

wack in ~/.bash_profile: