Enable
defaults write com.apple.Safari NSUserKeyEquivalents -dict-add Back "\U232b"
Disable
defaults delete com.apple.Safari NSUserKeyEquivalents
class ProgressBar | |
def initialize(units=60) | |
@units = units.to_f | |
end | |
def print(completed, total) | |
norm = 1.0 / (total / @units) | |
progress = (completed * norm).ceil | |
pending = @units - progress | |
Kernel.print "[#{'=' * progress }#{' ' * ( pending )}] #{percentage(completed, total)}%\r" |
#!/bin/sh | |
echo -n '{' | |
# memory as "mem": { "current": 800, "total": 1024, "load", 82 } where amount is in MB and load in % | |
free -m | awk 'NR==2{printf "\"mem\": { \"current\":%d, \"total\":%d, \"load\": %.2f }", $3,$2,$3*100/$2 }' | |
echo -n ',' | |
# diska as "disk": { "current": 6, "total": 40, "used": 19 } where amount is in GB and used in % | |
df -h | awk '$NF=="/"{printf "\"disk\": { \"current\":%d, \"total\":%d, \"used\": %d }", $3,$2,$5}' |
# usage: ssh <container-name>.doc | |
Host *.doc | |
ProxyCommand netcat $(docker inspect --format '{{ .NetworkSettings.IPAddress }}' `echo %h | sed -e 's/.doc//'`) 22 | |
StrictHostKeyChecking no | |
User root | |
IdentityFile /etc/ssh/keys/docker.key |
private static async Task<bool> UploadFile(string filePath, string actionUrl) | |
{ | |
FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read); | |
HttpContent filePathContent = new StringContent(filePath); | |
HttpContent fileStreamContent = new StreamContent(file); | |
using (var client = new HttpClient()) | |
using (var formData = new MultipartFormDataContent()) | |
{ | |
formData.Add(filePathContent, "filepath"); | |
formData.Add(fileStreamContent, "file", Path.GetFileName(filePath)); |
# taken from http://stackoverflow.com/questions/1960799/using-git-and-dropbox-together-effectively | |
~/project $ git init | |
~/project $ git add . | |
~/project $ git commit -m "first commit" | |
~/project $ cd ~/Dropbox/git | |
~/Dropbox/git $ git init --bare project.git | |
~/Dropbox/git $ cd ~/project |
Use an 8GB+ USB stick and format it with Mac OS Extended (Journaled) and name Untitled | |
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction |
Enable
defaults write com.apple.Safari NSUserKeyEquivalents -dict-add Back "\U232b"
Disable
defaults delete com.apple.Safari NSUserKeyEquivalents
# Apples build env's https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html | |
# | |
ROOT_PRODUCT_IDENTIFIER_PLIST=`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" $INFOPLIST_FILE` | |
export ROOT_PRODUCT_IDENTIFIER=`eval echo $ROOT_PRODUCT_IDENTIFIER_PLIST` |
# port from https://portal.redbridge.se/faq/api/guide/ | |
require 'openssl' | |
require 'digest/hmac' | |
require 'base64' | |
require 'cgi' | |
BASE_URL = "https://api.rbcloud.net/client/api" | |
API_KEY = "your api key" | |
SECRET_KEY = "your secret key" |
// in Go Play: http://play.golang.org/p/G5e-E8fe7h | |
package main | |
import "fmt" | |
func UniqStrs(slice []string) []string { | |
m := map[string]bool{} | |
for _, v := range slice { | |
m[v] = true | |
} |