$ docker rm $(docker ps -a -q)
$ docker rmi $(docker images -q)
# In .bashrc, .bash_profile, .zshrc, insert following the following | |
alias g=git | |
alias ga='git add' | |
alias gaa='git add --all' | |
alias gapa='git add --patch' | |
alias gau='git add --update' | |
alias gb='git branch' | |
alias gba='git branch -a' | |
alias gbd='git branch -d' |
function stringTColor(str) { | |
let hash = 0; | |
for (let i = 0; i < str.length; i++) { | |
hash = str.charCodeAt(i) + ((hash << 5) - hash); | |
} | |
let color = '#'; | |
for (let i = 0; i < 3; i++) { | |
let value = (hash >> (i * 8)) & 0xFF; | |
color += ('00' + value.toString(16)).substr(-2); | |
} |
function parseSearchString () { | |
var qs = window.location.search | |
qs = qs.replace(/^\?/,'') | |
var parts = qs.split('&') | |
var params = {} | |
parts.forEach(function (part) { | |
var pair = part.split('=') | |
params[pair[0]] = decodeURIComponent(pair[1]) | |
}) | |
return params |
FROM node:latest | |
MAINTAINER Dustin Schie, [email protected] | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY package.json /usr/src/app/ | |
RUN npm install |
/* HC-SR04 Sensor | |
https://www.dealextreme.com/p/hc-sr04-ultrasonic-sensor-distance-measuring-module-133696 | |
This sketch reads a HC-SR04 ultrasonic rangefinder and returns the | |
distance to the closest object in range. To do this, it sends a pulse | |
to the sensor to initiate a reading, then listens for a pulse | |
to return. The length of the returning pulse is proportional to | |
the distance of the object from the sensor. | |
The circuit: |
#include <LiquidCrystal.h> | |
// select the pins used on the LCD panel | |
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); | |
// define some values used by the panel and buttons | |
#define btnRIGHT 0 | |
#define btnUP 1 | |
#define btnDOWN 2 | |
#define btnLEFT 3 |
test |
# Example of using turtle, python's built-in graphics module | |
# import turtle with a new name | |
# who wants to write out t-u-r-t-l-e that many times? | |
import turtle as t | |
t.speed(5) # speed | |
t.pensize(5) # thickness | |
# convenience method for drawing circles |
# import the math module (this will be used in Circle class) | |
import math | |
# created a generic shape class | |
class Shape: | |
# the function to initialize the shape | |
def __init__(self, width, height): | |
# the properties of the shape | |
self.width = width | |
self.height = height |