Skip to content

Instantly share code, notes, and snippets.

View nubbel's full-sized avatar

Dominique d'Argent nubbel

View GitHub Profile
//
// ViewController.m
// DetectAlertView
//
// Created by Dominique d'Argent on 4/14/13.
// Copyright (c) 2013 Dominique d'Argent. All rights reserved.
//
#import "ViewController.h"
defmodule Teenager do
def hey(msg) do
msg |> interpret |> respond
end
defp interpret(""), do: :silence
defp interpret(msg) do
$ torquebox run
...
18:29:11,620 INFO [org.torquebox.core.runtime.DefaultRubyRuntimePool] (pool-1-thread-2) Deferring start for stomplets runtime pool.
...
18:29:11,629 INFO [org.torquebox.core.runtime] (pool-6-thread-1) Creating ruby runtime (ruby_version: RUBY1_9, compile_mode: JIT, app: BulletinBoard, context: stomplets)
...
18:29:27,121 INFO [org.torquebox.core.runtime] (pool-6-thread-1) Created ruby runtime (ruby_version: RUBY1_9, compile_mode: JIT, app: BulletinBoard, context: stomplets) in 15.49s
...
18:29:27,835 INFO [stdout] (pool-1-thread-4) [#<BulletinsStomplet:0x120d47>#configure] destination: [Topic: /topics/warp]
> reload in chrome
@nubbel
nubbel / main.go
Last active April 27, 2016 13:51
Go inTransaction usage example
package main
import (
"flag"
"log"
"database/sql"
_ "github.com/lib/pq"
)
@nubbel
nubbel / .gitattributes
Created July 21, 2016 12:09
Enables diffing Xcode Provisioning Profiles
*.mobileprovision diff=provisioningprofile
*.provisionprofile diff=provisioningprofile
import Foundation
extension NSURL : StringLiteralConvertible {
class func convertFromStringLiteral(value: String) -> Self {
return self(string: value)
}
class func convertFromExtendedGraphemeClusterLiteral(value: String) -> Self {
return self(string: value)
extension RawRepresentable where RawValue == Int {
static func enumerate() -> Self {
return self.init(rawValue: 0)!
}
static func makeIterator() -> AnyIterator<Self> {
var index = 0
return AnyIterator {
let value = Self.init(rawValue: index)
struct Manager {
final class Configuration {
var name: String = "default"
var timeout: Double = 500
}
private let configuration: Configuration
var name: String {
return configuration.name
id first_name last_name email
1 Ara Hackett ara.hackett@example.com
2 Marco Champlin champlin.marco@example.org
3 Martin Rogahn rogahn_martin@example.net
4 Marcos Turcotte turcotte.marcos@example.net
5 Jedediah Yundt yundt_jedediah@example.org
6 Vivien Schroeder schroeder.vivien@example.net
7 Leopold Cartwright leopold_cartwright@example.net
8 Euna Ernser ernser_euna@example.com
9 Rhianna Feeney rhianna_feeney@example.net
infix operator ??= {
associativity right
precedence 90
assignment
}
func ??=<T>(inout optional: T?, defaultValue: @autoclosure () -> T?) -> T? {
optional = optional ?? defaultValue()