An e-ink status board so my mum knows what's up
Node:
/** | |
* Overriding the keychain ngCordovaMock to use localStorage | |
**/ | |
angular.module('ngCordovaMocks') | |
.factory('$cordovaKeychain', ['$q', function ($q) { | |
console.log('persistent keychain mock loaded') | |
return { | |
getForKey: function (key, serviceName) { | |
// note: this implementation doesn't fail on an invalid servicename |
I hereby claim:
To claim this, I am signing this object:
# page-element-watcher | |
# | |
# Checks the contents of an element on a remote page and sends an SMS if it has changed | |
require 'nokogiri' | |
require 'open-uri' | |
require 'redis' | |
require 'twilio-ruby' | |
require 'rufus-scheduler' |
postgresql_id=$(docker ps | grep jeffutter/postgresql:latest | awk '{print $1}') | |
postgresql_private_ip=$(docker inspect ${postgresql_id} | grep IPAddress | awk '{ print $2 }' | tr -d ',"') | |
echo "pg ip: $postgresql_private_ip" | |
dokku config:set fun.with.co.de PG_HOST=$postgresql_private_ip | |
dokku config:set scotch.watch PG_HOST=$postgresql_private_ip |
# page-element-watcher | |
# | |
# Checks the contents of an element on a remote page and sends an SMS if it has changed | |
require 'nokogiri' | |
require 'open-uri' | |
require 'redis' | |
require 'twilio-ruby' |
currentLocale = 'en'; | |
locales = { | |
en: { | |
'common.between': 'less than __ but more than __' | |
} | |
}; | |
t = function(key, ...insertions) { | |
let translatedString = locales[currentLocale][key]; | |
return translatedString.replace(/__/g, () => insertions.shift()); |
w=console.log.bind(console),t=13,l=0,s=function(b,c){return new Array(b).join(c)}; | |
f=function(){clear();l=!l;w('\u001B[2J\u001B[0;0f');w(s(t-1,' ')+(l?'\\ /':''));w(s(t-3,' ')+(l?'-->*<--':' .')); | |
for(i=1;i<t;i++){w(s(t-i,' ')+'/'+s(i,'_'+(i%2?'/':'\\'))+'_\\')}w(s(t-2,' ')+'[___]');setTimeout(f,600)};f() |
I think the one-electron theory is my favourite physics theory. It's something I was taught that's come around on Hacker News recently https://en.wikipedia.org/wiki/One-electron_universe | |
**It involves a thought experiment.** | |
Imagine making jelly *(jello, if you're in the states)* with a load of string looped around, bundled, and set in it like a big suspended knot. Taking a cross-section of the jello will show a load of identical dots. They're seemingly un-connected, but _we know there's just one string they came from_. | |
Now extrapolate this out and imagine that the jelly is space-time, and any slice is our 3D world at a given time. Because we're bound by time we can only see one slice at a time. It seems to us that there are always a lot of identical dots - and we naturally assume each is a separate thing. | |
The one-electron theory asks whether this could be how we're perceiving electrons. Could there be one electron whizzing about space and time. At any given time, it would appear to us in multiple places |
import Enum | |
# build a deck of cards | |
deck = lc rank inlist '23456789TJQKA', suit inlist 'CDHS', do: [suit, rank] | |
# -> ['C2', 'D2', 'H2', 'S2', 'C3', 'D3', ... ] | |
# take 5 random cards from the deck | |
hand = deck |> shuffle |> take(5) | |
# -> ['D8', 'CQ', 'H2', 'H3', 'HK'] |