Skip to content

Instantly share code, notes, and snippets.

Make the branch and changes:
1. Create feature branch (git checkout -b feature)
2. Make changes in feature branch
3. Commit and push the changes (git add && git commit && git push origin feature)
Now we make our branch ready to merge:
4. Pull from master into your feature branch (git pull origin master)
5. Resolve merge conflicts
function xorswap(a,b) {
console.log(`a: ${a}, b: ${b}`)
b = b^a;
a = b^a;
b = b^a;
console.log(`a: ${a}, b: ${b}`)
}
let a = 3,
b = 10;
@bioid
bioid / log.js
Created May 31, 2018 23:06
overwrite console.log to add extra details
['log', 'warn', 'error'].forEach(function(method) {
var old = console[method];
console[method] = function() {
var stack = (new Error()).stack.split(/\n/);
// Chrome includes a single "Error" line, FF doesn't.
if (stack[0].indexOf('Error') === 0) {
stack = stack.slice(1);
}
var date = new Date();
var datetime = date.toLocaleString('en-US');
https://gist.github.com/anonymous/065b041bc99bcd3fd3d622d21996f2e7.js
https://gist.github.com/anonymous/065b041bc99bcd3fd3d622d21996f2e7.js
https://gist.github.com/anonymous/065b041bc99bcd3fd3d622d21996f2e7.js
https://gist.github.com/anonymous/065b041bc99bcd3fd3d622d21996f2e7.js
20:44:30 < bai> P is paste onto current line
20:44:32 < bai> p is paste onto next line
21:27:15 < j> v is the standard starting at this character, just start selecting
21:27:23 < j> shift+v is select only whole lines
21:27:27 < j> ctrl+v is the "box" select
21:28:19 < j> you know undo is u right
21:28:22 < j> and redo is R
21:29:07 < j> if you use visual select, it sets the anchors for you right
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 12 12:32:53 2016
@author: bioid
"""
from random import choice
colors = ['R', 'Y', 'G', 'B']
@bioid
bioid / asteroid.js
Last active August 29, 2015 14:07
Procedurally generated asteroids using perlin noise shader, implemented in elation engine using three.js
elation.component.add('engine.things.asteroid', function() {
this.postinit = function(){
this.defineProperties({
'seed': { type: 'float', default: Math.random() * 10 },
'factor1': { type: 'float', default: 1.2 }, // num ridges?
'factor2': { type: 'float', default: 1 }, // amount of deformation/ height of ridges?
'factor3': { type: 'float', default: 3 }, // elongation?
'factor4': { type: 'float', default: 1.3 }, // i really have no idea what any of these do
});
}