One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
// Compress and add javascript: prefix, then save as a bookmarklet | |
function process(image){ | |
h = image.height; w = image.width; | |
var buffer = document.createElement("canvas"); // Anonymous canvas | |
buffer.width = w;buffer.height=h; | |
var ct = buffer.getContext('2d'); | |
ct.drawImage(image,0,0); | |
var data = ct.getImageData(0,0,w,h).data; // This may raise an exception for external images. | |
var pxs=2; // Height-Width of the pixel block |
# Simple bijective function | |
# Basically encodes any integer into a base(n) string, | |
# where n is ALPHABET.length. | |
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047 | |
ALPHABET = | |
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//) | |
# make your own alphabet using: | |
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join |
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# prints a sparkline in the terminal using the supplied list of numbers | |
# examples: | |
# spark.rb 10 20 30 100 90 80 | |
# spark.rb 1 2 0.4 0.1 1.3 0.7 | |
@ticks = %w[▁ ▂ ▃ ▄ ▅ ▆ ▇] | |
values = ARGV.map { |x| x.to_f } |
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
<iamben> LMolr: yeah it's pretty easy. PORTAGE_BINHOST="http://packages.gentooexperimental.org/packages/amd64-stable/" emerge -G1av gcc glibc |
#!/bin/bash | |
# | |
# Batch Time-Lapse creation script. | |
# | |
# This script can be used to speed up, trim, and finally concatenate tens or | |
# even hundreds of video clips, e.g. from a dash cam. You can do other things, | |
# too, but the main things this script does include: | |
# | |
# 1. Copy across and speed up video clips from an input dir to an output dir. | |
# 2. Trim off the first x frames of each of the copied/sped up clips. |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
# Gawk version | |
# Remote | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}' | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}' | |
# No Gawk | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ |
Moved to https://github.com/markusressel/ESPHome-Smart-Scale |