(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 program is free software: you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation, either version 3 of the License, or | |
| * (at your option) any later version. | |
| */ | |
| #include <arpa/inet.h> | |
| #include <linux/if_packet.h> | |
| #include <stdio.h> |
| #!/usr/bin/env python | |
| # Haversine formula example in Python | |
| # Author: Wayne Dyck | |
| import math | |
| def distance(origin, destination): | |
| lat1, lon1 = origin | |
| lat2, lon2 = destination |
| public final class ResultFuture implements Future<Result> { | |
| private final CountDownLatch latch = new CountDownLatch(1); | |
| private Result value; | |
| @Override | |
| public boolean cancel(boolean mayInterruptIfRunning) { | |
| return false; | |
| } | |
| @Override |
| expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) ) |
| #!/bin/bash | |
| # This script builds the iOS and Mac openSSL libraries | |
| # Download openssl http://www.openssl.org/source/ and place the tarball next to this script | |
| # Credits: | |
| # https://github.com/st3fan/ios-openssl | |
| # https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |
(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.
Inspiration: Deis Commit Style Guide
I often quote Deis in sections below.
It makes going back and reading commits easier. It also allows you to spend less time thinking about what your commit message should be.
| # Place me in /etc/hotplug.d/iface/99-keepwanalive | |
| if [ "$ACTION" = "ifdown" -a "$INTERFACE" = "wan" ]; then | |
| COUNTER=0 | |
| PASS=0 | |
| while [ $PASS -eq 0 ] | |
| do | |
| grep "up" /sys/class/net/eth0/operstate > /dev/null |