- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
// Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust | |
// to work with Rust 1.0 beta | |
use std::net::{TcpStream, TcpListener}; | |
use std::io::{Read, Write}; | |
use std::thread; | |
fn handle_read(mut stream: &TcpStream) { | |
let mut buf = [0u8 ;4096]; |
source :rubygems | |
gem 'sinatra' |
<?XML version="1.0"?> | |
<scriptlet> | |
<registration | |
progid="PoC" | |
classid="{F0001111-0000-0000-0000-0000FEEDACDC}" > | |
<!-- Proof Of Concept - Casey Smith @subTee --> | |
<!-- License: BSD3-Clause --> | |
<script language="JScript"> | |
<![CDATA[ | |
I hereby claim:
To claim this, I am signing this object:
(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.
@interface UIImage (Orientation) | |
- (UIImage*)imageByNormalizingOrientation; | |
@end | |
@implementation UIImage (Orientation) | |
- (UIImage*)imageByNormalizingOrientation { |
import Foundation | |
typealias RegexPattern = String | |
let aussiePhoneNumber = 0424_555_123 | |
let brokePhoneNumber = 0424_555_1231 | |
enum PhoneNumberType: RegexPattern { | |
// List all regex patterns | |
case AussieMobile = "(?:\\+?61|0)4(?:[01]\\d{3}|(?:2[1-9]|3[0-57-9]|4[7-9]|5[0-15-9]|6[679]|7[3-8]|8[1478]|9[07-9])\\d{2}|(?:20[2-9]|444|52[0-6]|68[3-9]|70[0-7]|79[01]|820|890|91[0-4])\\d|(?:200[0-3]|201[01]|8984))\\d{4}$" |
// ACTIONS & REDUCERS | |
enum CounterAction { | |
case Increment | |
case Decrement | |
case ChangeBy(Int) | |
} | |
enum NameAction { | |
case Set(String) | |
case Clear | |
} |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct _node node; | |
typedef void (*apply)(node *); | |
struct _node { | |
struct _node *left; | |
struct _node *right; |