Chromium OS is cool. Chromium OS with crouton is cooler. Chromium OS with Docker is even cooler. This is specifically a guide for the Chromebook Pixel 2 (2015), but I can't think of any reason it wouldn't work with other devices.
[alias] | |
fire = !"f() { \ | |
local current_branch=$(basename \"$(git symbolic-ref HEAD)\"); \ | |
local new_branch=fire-${current_branch}-$(git config user.email)-$(date +%s) \ | |
local message; \ | |
if [ -z \"$1\" ]; then \ | |
message=\"fire commit from $current_branch\"; \ | |
else \ | |
message=\"$*\"; \ | |
fi; \ |
describe('something', function() { | |
beforeEach(function() { | |
this.getAttributeStub = sinon.stub(Xrm.Page, 'getAttribute'); | |
}); | |
afterEach(function() { | |
this.getAttributeStub.restore(); | |
}); | |
it('tests something', function() { |
#System Design Cheatsheet
Picking the right architecture = Picking the right battles + Managing trade-offs
##Basic Steps
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
Dropbox has a long-standing bug with changing case of files and directories. This is a work around.
It renames the directoy name to name+1 and then to lowercase name.
CatPants
is renamed toCatPants1
CatPants1
is then renamed tocatpants
function p(u,p,c){with(new XMLHttpRequest)open('POST',u),setRequestHeader('Content-type','application/x-www-form-urlencoded'),onreadystatechange=function(){3<readyState&&c(this)},send(p)} |
ffmpeg -re -i rtmp://localhost/live/input_stream -acodec libfaac -ab 128k -vcodec libx264 -s 640x360 -b:v 500k -preset medium -vprofile baseline -r 25 -f flv rtmp://localhost/live/medium_500k -acodec libfaac -ab 128k -vcodec libx264 -s 480x272 -b:v 300k -preset medium -vprofile baseline -r 25 -f flv rtmp://localhost/live/medium_300k -acodec libfaac -ab 128k -c:v libx264 -s 320x200 -b:v 150k -preset:v fast -profile:v baseline -level 1.2 -r 25 -f flv rtmp://localhost/live/medium_150k -acodec libfaac -vn -ab 48k -f flv rtmp://localhost/live/audio_only |
#!/usr/bin/env bash | |
# On OS X, use this script to generate an encrypted deployment key for Travis CI. | |
# Dependencies: | |
# gem install travis | |
# brew install coreutils | |
if [ $# -lt 1 ]; then | |
echo "usage: $0 <user>/<repo>" |
This short code will show how to sync database file using Realm, but can be used for any file that you need to send to Wear (using Data API
). It just takes any file, change it to Asset
object and send it over to Wear device. Also it can be used Mobile->Wear, and Wear->Mobile.
When you need to sync database just call FileSender.syncRealm(context);
, that is it!
DISCLAIMER
"Proper" way would be to synchronize each transaction to DB, but it in most cases Wear is used very rarely comparing to mobile, so it would most likely cause a battery drain. My idea was to synchronize it only whene it is needed (so for example when app closes). If you want to make sure that you are using latest DB, just send trigger data using MessageAPI
from Wear to Phone with ask of syncing over its database, or keep some timestapm of last edit and check it.
function defaultDict(constructor) { | |
return new Proxy({}, { | |
get: function(object, property) { | |
return property in object | |
? object[property] | |
: object[property] = constructor() | |
; | |
} | |
}); | |
} |