(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.
| // Creating Google’s “Material Design” in SCSS | |
| // (specifically Material Shadow, uses compass) | |
| // see: http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-paper-craft | |
| // Demo: http://codepen.io/stoikerty/full/Glwxi/ | |
| // Animating Box-Shadow is EXPENSIVE: | |
| // http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/#toc- | |
| // Moving between z-index-depths is done via opacity & multiple |
| # This is an example of the Stack Exchange Tier 1 HAProxy config | |
| # The only things that have been changed from what we are running are: | |
| # 1. User names have been removed | |
| # 2. All Passwords have been remove | |
| # 3. IPs have been changed to use the example/documentation ranges | |
| # 4. Rate limit numbers have been changed to randome numbers, don't read into them | |
| userlist stats-auth | |
| group admin users $admin_user | |
| user $admin_user insecure-password $some_password |
| #cloud-config | |
| coreos: | |
| etcd: | |
| # generate a new token for each unique cluster from https://discovery.etcd.io/new | |
| discovery: https://discovery.etcd.io/<token> | |
| # multi-region deployments, multi-cloud deployments, and droplets without | |
| # private networking need to use $public_ipv4 | |
| addr: $private_ipv4:4001 | |
| peer-addr: $private_ipv4:7001 |
| /** | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2015 Circle Internet Financial | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| while true | |
| do | |
| echo -n "stats.timers.kamon.localhost.system-metric.cpu.cpu-user.mean_99:$(((RANDOM % 10) + 1))|c" | nc -w 1 -u localhost 8125 | |
| done |
| #!/usr/bin/python | |
| import collections | |
| import json | |
| import os | |
| import signal | |
| import sys | |
| import subprocess | |
| # require pygithub installed | |
| from github import Github |
| #!/bin/sh | |
| cat > /etc/network/interfaces.d/eth0-0.cfg <<EOF | |
| auto eth0:0 | |
| allow-hotplug eth0:0 | |
| iface eth0:0 inet static | |
| address 178.32.XXX.XXX | |
| netmask 255.255.255.255 | |
| broadcast 178.32.XXX.XXX | |
| post-up /sbin/ip route replace default via $(/sbin/ip route | awk '/default/ { print $3 }') dev eth0 src 178.32.XXX.XXX |
| <?php | |
| /** | |
| * @param $http2ch the curl connection | |
| * @param $http2_server the Apple server url | |
| * @param $apple_cert the path to the certificate | |
| * @param $app_bundle_id the app bundle id | |
| * @param $message the payload to send (JSON) | |
| * @param $token the token of the device | |
| * @return mixed the status code (see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW18) |
| //**dataURL to blob** | |
| function dataURLtoBlob(dataurl) { | |
| var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], | |
| bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); | |
| while(n--){ | |
| u8arr[n] = bstr.charCodeAt(n); | |
| } | |
| return new Blob([u8arr], {type:mime}); | |
| } |