Skip to content

Instantly share code, notes, and snippets.

@veev
veev / .block
Created November 21, 2018 01:52
fresh block
license: mit
@veev
veev / PairingWorkshopRefucktoring.md
Created January 10, 2018 20:39
Instructions for Refucktoring Workshop

Pairing Workshop

Break out into groups of two, based on the language you want to work in. You don't have to be at the same level of fluency, in fact, often it's better if you're not.

The first step is to code something with your partner, it could be generating the Fibonacci Sequence, or something as simple as "Hello World." Then, the real goal is to refucktor the code so that it still passes a test, but is hard to read, inefficient, unnecessarily memory intensive, really the impossible-to-maintain sky is the limit!

After each small change, run a test to make sure it's still working. This could be a test you run with a testing environment, or just printing the result of the function and seeing if it throws an error.

Start by implementing a solution for a code challenge

@veev
veev / sketch.js
Created November 20, 2017 01:20
Mappa with MapboxGL and boolean logic
// Your Mapboxgl API Key
let key = ''; // <your access token here>;
// Create a new Mappa instance using Mapboxgl.
let mappa = new Mappa('Mapboxgl', key);
let myMap;
let canvas;
let flyNow = false;
@veev
veev / sketch.js
Created November 19, 2017 18:38
Mappa with MapboxGL JS - fly to
// Your Mapboxgl API Key
let key = ''; // <your access token here>;
// Create a new Mappa instance using Mapboxgl.
let mappa = new Mappa('Mapboxgl', key);
let myMap;
let canvas;
// Map options
let options = {
// I made this when I was experimenting with Moiré patterns and
// trying to generate ways to print out designs that would animate
// if you put the right interference line pattern over it and moved it across.
// Much like the book by Takahiro Kurashima, Poemotion: http://andpens.com/tag/moire-pattern/
int frame = 0;
int wallOffset = 0;
final int windowWidth = 1;
final int wallWidth = 4;
{
"results": {
"type": "FeatureCollection",
"features": [
{
"geometry": {
"coordinates": [
18.354258,
-12.704508,
1420.4
import processing.serial.*;
import processing.sound.*;
SoundFile[] soundFiles = new SoundFile[5];
Serial myPort; // Create object from Serial class
int[] ldrValues;
int[] thresholds = {650, 590, 500, 650, 400};
boolean[] states = {false, false, false, false, false};
/*
Analog input, analog output, serial output
Reads an analog input pin, maps the result to a range from 0 to 255
and uses the result to set the pulsewidth modulation (PWM) of an output pin.
Also prints the results to the serial monitor.
The circuit:
potentiometer connected to analog pin 0.
Center pin of the potentiometer goes to the analog pin.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import urllib2
import base64
import xml
import sys
import time
function buildRippleNode(index){
var ripple, title, bottomLetter, topLetter;
var offset = 180;
var pos = (offset * index) + offset; //radius of Home Button
var titleOffset = config.titleOffset;
var titleHeight = config.titleHeight;
ripple = paper.path("M0,0 L"+pos+",0 A"+pos+","+pos+" 0 0,1 0,"+pos+"z")
ripple.attr({'fill': COLORS[index], 'fill': URL[index], 'stroke': COLORS[index]})
.data('id', RIPPLE_ID[index]);
title = paper.text(pos - titleOffset, titleHeight, LABELS[index]).attr({'font-size': '24px', 'font-style': 'italic', 'opacity': 1});