(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.
(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.
-- Create a group | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
class A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
// Coproduct is extension of Either concept, to N multually exlusive choices | |
type ISB = Int :+: String :+: Boolean :+: CNil | |
val isb = Coproduct[ISB]("foo") //> isb : qaaz.ISB = foo | |
isb.select[Int] //> res0: Option[Int] = None | |
isb.select[String] //> res1: Option[String] = Some(foo) |
MANIFEST_FILE='AndroidManifest.xml' | |
VERSIONCODE=`grep versionCode $MANIFEST_FILE | sed 's/.*versionCode="//;s/".*//'` | |
VERSIONNAME=`grep versionName $MANIFEST_FILE | sed 's/.*versionName="//;s/\.[0-9]*".*//'` | |
NEWCODE=$BUILD_NUMBER | |
NEWNAME=$VERSIONNAME.$BUILD_NUMBER | |
echo "Updating Android build information. New version code: $NEWCODE - New version name: $NEWNAME"; | |
sed -i 's/versionCode *= *"'$VERSIONCODE'"/versionCode="'$NEWCODE'"/; s/versionName *= *"[^"]*"/versionName="'$NEWNAME'"/' $MANIFEST_FILE |
import org.mozilla.javascript.Context; | |
import org.mozilla.javascript.Function; | |
import org.mozilla.javascript.NativeObject; | |
import org.mozilla.javascript.Scriptable; | |
import org.mozilla.javascript.commonjs.module.Require; | |
import org.mozilla.javascript.commonjs.module.RequireBuilder; | |
import org.mozilla.javascript.commonjs.module.provider.SoftCachingModuleScriptProvider; | |
import org.mozilla.javascript.commonjs.module.provider.UrlModuleSourceProvider; | |
import java.io.File; |
# Just put this in your cron (Runs every 1 minute). | |
# * * * * * /home/YOURUSERNAME/bin/suspend-on-low-battery | |
source /nix/var/nix/profiles/system/etc/profile | |
UPOWER=$(nix-build -A upower '<nixpkgs>')/bin/upower | |
NOTIFY_SEND=$(nix-build -A libnotify '<nixpkgs>')/bin/notify-send | |
DISPLAY=:0.0 | |
battery_device=`$UPOWER -e | grep -i battery | head -n 1` |