This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __guard_QKVOForwarding_h__ | |
#define __guard_QKVOForwarding_h__ | |
#import <Foundation/Foundation.h> | |
@interface NSObject (QKVOForwarding) | |
+ (NSUInteger)maxCachedSelectorCountForForwarding; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BlockIterator | |
def initialize(args, &block) | |
@block = block | |
@args = args | |
end | |
def each | |
if block_given? | |
begin | |
while true ; yield @block[*@args] ; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Lexer | |
include Enumerable | |
def self.const_set(sym, obj) const_set(sym, obj.freeze) end | |
class Error < ::Exception ; end | |
# Token = Struct.new(:kind, :value, :position, :line, :column, :__mark) | |
class Token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# sign.sh -- signing utility for Android APKs | |
# Made by Noel Cower. This file is public domain, or at least I'm not | |
# going to care what you do with it. | |
# | |
RED='[31;m' | |
GREEN='[32;m' | |
YELLOW='[33;m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <type_traits> | |
#include <iostream> | |
class boxed_t | |
{ | |
public: | |
virtual ~boxed_t() = 0; | |
virtual int type_id() const = 0; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Key path constructor object. Builds up a key path for most instance methods | |
# called against itself. | |
# | |
class KeyPathCtor | |
def self.forwarding_method(name, old_name = nil) | |
old_name ||= name | |
define_method(name, -> (*args) do | |
if args.empty? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Puts any directory with a .go-root file into the GOPATH then launches go. | |
__gopath_for_dir__() { | |
test_goroot="$1/.go-root" | |
if [[ -f "$test_goroot" ]] ; then | |
echo "${2:+$2:}$1" | |
else | |
echo "$2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -w | |
# Copyright 2014 Noel Cower | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def max(list: List[Int]): Int = list match { | |
case Nil => throw new NoSuchElementException | |
case List(x) => x | |
case x +: tail => | |
val rhs = max(tail) | |
if (x >= rhs) x else rhs | |
} |
OlderNewer