(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef compile_time_hash_h | |
#define compile_time_hash_h | |
// Posted by jbowes. Public domain. | |
// source: (dead link) | |
// http://lol.zoy.org/blog/2011/12/20/cpp-constant-string-hash | |
// | |
// At higher compiler optimization levels (-O1 and higher on clang/llvm), | |
// C_HASH("string") should be replaced by a hash of "string" at compile time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type F func(i int) int | |
func (f F) compose(inner F) F { | |
return func(i int) int { return f(inner(i)) } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installing Arch: | |
sudo vim /etc/pacman.conf | |
Update packages list: sudo pacman -Syy | |
run sudo pacman -Syu before installing any software (to update the repositories first) | |
* Timing issue: | |
- Change hardware clock to use UTC time: | |
sudo timedatectl set-local-rtc 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-webkit-scrollbar { | |
background: transparent; | |
overflow: visible; | |
width: 17px; | |
} | |
::-webkit-scrollbar-thumb { | |
background-color: rgba(0, 0, 0, 0.2); | |
border: solid #fff; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services | |
Download the following ZIPs: | |
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
Download the correct GApps for your Android version: | |
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.json.JSONObject; | |
import org.json.JSONTokener; | |
import com.google.api.client.extensions.appengine.http.UrlFetchTransport; | |
import com.google.api.client.http.GenericUrl; | |
import com.google.api.client.http.HttpContent; | |
import com.google.api.client.http.HttpRequest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Call with a percentage value from 0 to 100 | |
# 0 means only red and green, 50 means half of blue is shown through | |
# if you don't give any arguments the calibration is cleared | |
if [[ -z "$1" ]]; then | |
echo Clearing all calibrations | |
xcalib -clear | |
else |