A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
Small refactorings made to original code:
| defmodule MyApp.CLI do | |
| def main(_args) do | |
| IO.puts("Hello from MyApp!") | |
| end | |
| end |
A running example of the code from:
Small refactorings made to original code:
| var apn = require("apn") | |
| var apnError = function(err){ | |
| console.log("APN Error:", err); | |
| } | |
| var options = { | |
| "cert": "cert.pem", | |
| "key": "key.pem", | |
| "passphrase": null, |
| var AWS = require('aws-sdk'); | |
| AWS.config.update({ | |
| accessKeyId: '{AWS_KEY}', | |
| secretAccessKey: '{AWS_SECRET}', | |
| region: '{SNS_REGION}' | |
| }); | |
| var sns = new AWS.SNS(); |
| require 'formula' | |
| class LibdnetPython <Formula | |
| depends_on 'libdnet' | |
| url 'http://libdnet.googlecode.com/files/libdnet-1.12.tgz' | |
| homepage 'http://code.google.com/p/libdnet/' | |
| sha1 '71302be302e84fc19b559e811951b5d600d976f8' | |
| def install | |
| ENV["CFLAGS"] = "-O3 -w -pipe" |
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
| * 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
| * 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
| * latter ones will sort after the former ones. We do this by using the previous random bits | |
| * but "incrementing" them by 1 (only in the case of a timestamp collision). | |
| */ |
| import GLKit | |
| // Uniform index. | |
| private enum Uniform { | |
| case ModelViewProjectionMatrix, NormalMatrix | |
| } | |
| private var gUniforms: [Uniform: GLint] = [:] | |
| extension GLKMatrix3 { | |
| var array: [Float] { |
| //This was taken from the Swift OpenGL Example on GitHub | |
| // View code | |
| import Foundation | |
| import UIKit | |
| import QuartzCore | |
| import OpenGLES | |
| import GLKit | |
| require 'sinatra' | |
| require 'slim' | |
| require 'coffee-script' | |
| require 'sass' | |
| require 'sequel' | |
| DB = Sequel.sqlite | |
| DB.create_table :uploads do | |
| String :id, text: true, primary_key: true |
| // | |
| // Swift-KVO | |
| // | |
| // Created by Jim Correia on 6/5/14. | |
| // Copyright (c) Jim Correia. All rights reserved. | |
| // | |
| // Update: 6/17/2014 | |
| // | |
| // KVOContext has gone away; use the same idiom you'd use from Objective-C for the context |