-
install docker ... really, you need to look at containers !!!
-
docker pull golang
-
pretend we have go installed
echo 'alias go="docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang go "' >> ~/.bash_profile source ~/.bash_profile
// https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c | |
// #!/usr/bin/env bash | |
// case `uname -s` in | |
// Linux*) sslConfig=/etc/ssl/openssl.cnf;; | |
// Darwin*) sslConfig=/System/Library/OpenSSL/openssl.cnf;; | |
// esac | |
// openssl req \ | |
// -newkey rsa:2048 \ | |
// -x509 \ |
require "crystagiri" | |
SEEN = Set(String).new | |
def parse(url) | |
return if SEEN.includes?(url) | |
SEEN.add url | |
begin | |
Crystagiri::HTML.from_url(url).css("a") do |anchor| |
class window.Tokenfield | |
# create the object | |
constructor: (target)-> | |
@properties= | |
target_object: $(target) | |
separator_key_codes: [9, 10, 12, 13] # maps to keyboard KEYS | |
separator_char_codes: [9, 10, 11, 12, 13, 44, 58, 59].map (i)-> String.fromCharCode(i) # characters (for paste) | |
del: [8] | |
min_input_width: 200 # default, can be overidden in css | |
token_list: [] |
some_var = [Int32.new(0), nil, ""].first |
require "http/client" | |
module Cyrl | |
url = ARGV[0] | |
out_path = ARGV[1] | |
File.open(out_path, "w") do |output| | |
HTTP::Client.get(url) do |response| | |
IO.copy(response.body_io, output) | |
end |
some_service: | |
image: some_image/that_runs_the_code_above:when_necessary | |
target_num_containers: 1 # dont use autoscaling ... kinda defeats the purpose | |
autorestart: false # you might think of a reason to make this autorestart ... | |
roles: # allow access to the api | |
- global |
// create a Range | |
val y = 1 to 20 // => Range(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) | |
// Reduce the list (ok its not a List, but you get the idea), just because! | |
val threes = for (i <- y if i % 3 == 0) yield i // => Vector(3, 6, 9, 12, 15, 18) | |
// and Map | |
val squares = for (i <- y if i % 3 == 0) yield i * i // => Vector(9, 36, 81, 144, 225, 324) |
package blahblah; | |
import scala.collection.JavaConverters._ | |
import java.net.URLDecoder | |
import com.amazonaws.services.lambda.runtime.Context | |
import com.amazonaws.services.sns.AmazonSNSClient | |
import com.amazonaws.services.sns.model.PublishRequest | |
import java.io.{InputStream, OutputStream, PrintStream} |
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint") | |
lazy val root = (project in file(".")). | |
settings( | |
name := "lambda-demo", | |
version := "1.0", | |
scalaVersion := "2.11.4", | |
retrieveManaged := true, | |
libraryDependencies += "com.amazonaws" % "aws-lambda-java-core" % "1.0.0", | |
libraryDependencies += "com.amazonaws" % "aws-lambda-java-events" % "1.0.0", |