Ability to implement complex syntactic constructs that otherwise might not be possible in an arbitrary language.
- Ruby
| // | |
| // SFGCollagePreparer.m | |
| // SFG | |
| // | |
| // Created by Jeremy Tregunna on 2015-07-16. | |
| // Copyright (c) 2015 Shutterfly. All rights reserved. | |
| // | |
| #import "SFGCollagePreparer.h" | |
| #import "SFGAreaOfInterest.h" |
| #import "Super.h" | |
| @interface A : Super | |
| - (instancetype)initWithMagic __attribute__((unavailable("Invoke the designated initializer `initWithPuppies` instead."))) | |
| - (instancetype)initWithPuppies; | |
| @end |
| KEYWORDS="TODO:|FIXME:|DevTeam:|XXX:|QRKPending" | |
| find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -o -prune Pods \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/" |
| public func memoize<T: Hashable, U>(body: ((T) -> U, T) -> U) -> (T) -> U { | |
| var memo = Dictionary<T, U>() | |
| var result: ((T) -> U)! | |
| result = { x in | |
| if let q = memo[x] { | |
| return q | |
| } | |
| let r = body(result, x) | |
| memo[x] = r | |
| return r |
| #!/bin/zsh | |
| if [ X"$1" = X"-h" ]; then | |
| echo "Usage: git grab [remote]" | |
| echo " Fetches changes from the supplied remote, or origin if omitted and rebases changes" | |
| echo " onto your branch." | |
| exit 0 | |
| fi | |
| REMOTE=$1 |
| #!/bin/sh | |
| . git-simple-common.sh | |
| if [ X"$1" = X"-h" ]; then | |
| echo "Usage: git switch [branch]" | |
| echo " Performs an optional stash of current changes before switching to [branch] where it" | |
| echo " checks for any stashes that can be popped, and applies those." | |
| exit 0 | |
| fi |
| # Heavy State Sync | |
| require 'faye/websocket' | |
| require 'json' | |
| class HeavyStateSync | |
| KEEPALIVE_INTERVAL = 15 | |
| def initialize(app) | |
| @app = app |
| use std::comm; | |
| use std::io::net::ip; | |
| use std::io::net::tcp; | |
| //use extra::uv; | |
| use std::comm; | |
| use std::io; | |
| use std::result; | |
| use std::task; | |
| type ConnectMsg = (tcp::TcpNewConnection, comm::channel<Option<tcp::TcpErrData>>); |
| #include <iostream> | |
| using namespace std; | |
| template<class X> using Maybe = std::unique_ptr<X>; | |
| template<class X> Maybe<X> Just(const X& x) | |
| { | |
| return Maybe<X>( new X(x) ); | |
| } |