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
; Find Nth algorithm | |
; | |
; This algorithm finds the nth largest element in a list. First, it sorts | |
; the list in descending order and then places the value at index n in | |
; location 127. | |
; | |
; Dynamic Instruction Count for 19.b. at location 30 | |
; 18,240 instructions | |
; 30th largest element in given array is 32 | |
; |
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
irb(main):083:0> order.save.explain | |
(0.4ms) BEGIN | |
SQL (15.1ms) INSERT INTO "orders" ("address_id", "created_at", "customer_id", "order_request_id", "price_cents", "shipping_price_cents", "source", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["address_id", 291085], ["created_at", Wed, 10 Sep 2014 19:07:34 UTC +00:00], ["customer_id", 63601], ["order_request_id", "2687c3b4-c0b3-44a1-887d-04073ae62d1b"], ["price_cents", 8900], ["shipping_price_cents", 1200], ["source", "web-cart"], ["updated_at", Wed, 10 Sep 2014 19:07:34 UTC +00:00]] | |
SQL (4.1ms) UPDATE "customers" SET "orders_count" = COALESCE("orders_count", 0) + 1 WHERE "customers"."id" = 63601 | |
SQL (7.9ms) INSERT INTO "order_items" ("created_at", "order_id", "photo_count", "printer", "product", "source", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 10 Sep 2014 19:07:34 UTC +00:00], ["order_id", 80566], ["photo_count", 3], ["printer", 1], ["product", "calendardateless"], ["so |
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
Resque.after_fork do |job| | |
$rabbitmq_connection = Bunny.new(AMQP_URL) | |
$rabbitmq_connection.start | |
$rabbitmq_channel = $rabbitmq_connection.create_channel | |
$rabbitmq_exchange = $rabbitmq_channel.topic('stream', durable: true) | |
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
adamkuipers@Adams-MacBook-Air ~ | |
% curl https://www.google.com/\#q\=elm+lang !10002 | |
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." name="description"><meta content="noodp" name="robots"><meta content="/images/google_favicon_128.png" itemprop="image"><title>Google</title><script>(function(){window.google={kEI:'jIKTVYOpE5bioASHj4SoDw',kEXPI:'3700268,4010073,4029815,4032235,4032500,4032677,4032998,4033307,4033344,4036363,4036366,4036425,4036471,4036486,4036847,4036948,4037333,4037457,4037855,4037921,4037960,4038216,4038417,4038464,4038961,4039016,4039046,4039263,4039280,4039382,4039386,4039403,4039879,4039908,4040020,4040028,4040117,4040136,8300096,8300200,8300202,8500394,8501258,8501295,8501407,8501489,10200083',authuser:0,kscs:'c9c918f0_10'};google.kHL='en';})();(functio |
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
adamkuipers@Adams-MacBook-Pro ~ | |
% echo $GIT_COMMITTER_EMAIL | |
adamkuipers@Adams-MacBook-Pro ~ | |
% cd development/sps/PrintStudio-iOS | |
adamkuipers@Adams-MacBook-Pro ~/development/sps/PrintStudio-iOS [country-picker *] | |
± % echo $GIT_COMMITTER_EMAIL | |
adam@socialprintstudio.com |
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
// Doesn't work. | |
func doBimpy(f1: Bimpy, _ f2: Bimpy) -> Bimpy { | |
return Bimpy() | |
} | |
// Works | |
func doBimpy2(f1: Bimpy, _ f2: Bimpy) -> Bimpy { | |
return Bimpy() | |
} |
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
// Based off of https://gist.github.com/runarorama/33986541f0f1ddf4a3c7 | |
protocol λ { | |
typealias α | |
} | |
struct K<L: λ>: λ { | |
typealias α = L.α | |
} |
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 Parser<T> : StringLiteralConvertible { | |
typealias StringLiteralType = Swift.StringLiteralType | |
typealias ExtendedGraphemeClusterLiteralType = ExtendedGraphemeClusterType | |
typealias UnicodeScalarLiteralType = UnicodeScalarType | |
let token: String | |
required init(stringLiteral value: StringLiteralType) { | |
self.token = value | |
} |
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
scala> val x1: Float = Long.MaxValue | |
x1: Float = 9.223372E18 | |
scala> val x2 = Long.MaxValue - Int.MaxValue | |
x2: Long = 9223372034707292160 | |
scala> x1 == x2 | |
res0: Boolean = true |
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
//: Playground - noun: a place where people can play | |
protocol HList {} | |
struct HNil: HList {} | |
struct HCons<Element, List: HList>: HList { | |
let head: Element | |
let tail: List | |
} | |
infix operator |*| { associativity right } |
OlderNewer