omg, so much freelancer money! http://colormind.io/bootstrap/
actual color wheel related things?! http://serennu.com/colour/colourcalculator.php
#!/bin/bash | |
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" | |
let secs=$((${upSeconds}%60)) | |
let mins=$((${upSeconds}/60%60)) | |
let hours=$((${upSeconds}/3600%24)) | |
let days=$((${upSeconds}/86400)) | |
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"` | |
IP4=`ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'` | |
# get the load averages |
#include <Servo.h> | |
#include "I2Cdev.h" | |
#include "MPU6050_6Axis_MotionApps20.h" | |
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE | |
#include "Wire.h" | |
#endif | |
Servo botServo; | |
Servo topServo; |
omg, so much freelancer money! http://colormind.io/bootstrap/
actual color wheel related things?! http://serennu.com/colour/colourcalculator.php
int led_pin = 8; | |
int switch_pin = 9; | |
int pot_pin_1 = A1; | |
int pot_pin_2 = A2; | |
int pot_pin_3 = A3; | |
int last_switch_state = LOW; | |
void setup() { | |
pinMode(led_pin, OUTPUT); | |
pinMode(pot_pin_1, INPUT); |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# Change bash prompt emoji by time. | |
time_emoji() { | |
CURRENT_HOUR=`date +"%-H"` | |
if [ "$CURRENT_HOUR" -ge 17 ] && [ "$CURRENT_HOUR" -le 23 ]; then | |
echo $'\xF0\x9F\x8D\xBA' # beer | |
else |
#!python | |
"""Bootstrap distribute installation | |
If you want to use setuptools in your package's setup.py, just include this | |
file in the same directory with it, and add this to the top of your setup.py:: | |
from distribute_setup import use_setuptools | |
use_setuptools() | |
If you want to require a specific version of setuptools, set a download |
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] |
(defadvice ruby-indent-line (after unindent-closing-paren activate) | |
(let ((column (current-column)) | |
indent offset) | |
(save-excursion | |
(back-to-indentation) | |
(let ((state (syntax-ppss))) | |
(setq offset (- column (current-column))) | |
(when (and (eq (char-after) ?\)) | |
(not (zerop (car state)))) | |
(goto-char (cadr state)) |
for i in *.png; do [[ "$i" = *-* ]] && mv -nv -- "$i" "${i//-/_}"; done |
#!/usr/bin/env ruby | |
require 'thor' | |
class SSHConfig < Thor | |
desc "list", "list all hosts" | |
def list() | |
f = File.open("/Users/#{ENV['USER']}/.ssh/config", 'r') | |
hosts = f.select { |line| line =~ /Host\s/ } | |
hosts.map { |host| host[4..-1].strip }.each do |host| |