Input file:
$ cat foo
qwe
123
bar
func expand(s string, f func(string) string) string { | |
if len(s) < len(FOO) { | |
return s | |
} | |
for i := strings.Index(s, FOO); i != -1; i = strings.Index(s, FOO){ | |
t := s[:i] | |
t = t + f(s[i+1:i+len(FOO)]) | |
t = t + s[i+len(FOO):] | |
s = t | |
} |
~/code/maxwellforest/onefill_maps_api $ curl "https://mighty-wildwood-25794.herokuapp.com/v0/sites/562" -X GET \ | |
-H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: " | |
{"site":{"id":562,"blocked":false,"name":"Coffee Company","normalized_name":"Coffee Company","url":"https://www.coffeecompany.com.au","logo":{"content_type":"image/png","url":{"x1":"//s3-ap-southeast-2.amazonaws.com/76f1fe6d3b3/sites/logos/000/000/562/x1/open-uri20160902-3-t40872?1474272742","x2":"//s3-ap-southeast-2.amazonaws.com/76f1fe6d3b3/sites/logos/000/000/562/x2/open-uri20160902-3-t40872?1474272742","x3":"//s3-ap-southeast-2.amazonaws.com/76f1fe6d3b3/sites/logos/000/000/562/x3/open-uri20160902-3-t40872?1474272742","original":"//s3-ap-southeast-2.amazonaws.com/76f1fe6d3b3/sites/logos/000/000/562/original/open-uri20160902-3-t40872?1474272742"}},"updated_at":"2016-09-19T18:12:24.544+10:00","created_at":"2016-09-02T10:43:36.143+10:00","fetch_count":188,"deleted_at":null,"featured":null,"flow_mappings": |
require 'json' | |
require 'net/http' | |
require 'thread' | |
if RUBY_VERSION.to_i < 2 | |
puts "Use a modern ruby => 2.3.1 suggested" | |
return 1; | |
end | |
API_ENDPOINT = 'http://mighty-wildwood-25794.herokuapp.com/' |
#!/bin/sh | |
time -f '%Uu %Ss %er %MkB %C' "$@" |
// imported with `import {*Strategy from 'ember-macros'}` | |
// @TODO: Find ember-cli-compatible | |
import E from 'ember'; | |
export let isContractorsStrategy = E.Mixin.create({ | |
isProductsStrategy: E.computed('strategy', function(){ | |
return this.get('strategy') === "products"; | |
}) | |
}); | |
export let isProductsStrategy = E.Mixin.create({ |
persistAttachment(){ | |
this.set('isLoading', true); | |
return new E.RSVP.Promise(function(resolve, reject){ | |
let [formData, model, adapter] = [new FormData(), this.getModel(), window.App.lookup('adapter:attachment')]; | |
let [ajaxOptions, snapshot, contentType] = [adapter.ajaxOptions(), model._createSnapshot(), model.get('content_type')]; | |
let url = adapter.urlForCreateRecord('task', snapshot); | |
let normalizeAjaxOptions = (ao)=>{ | |
ao.type = 'POST'; | |
ao.url = url; |
Ruby Memory Model | |
Indented italic paragraphs are used for notes. | |
This document is work-in-progress. Intentions of this effort and document are: to summarize the behavior of Ruby in concurrent and parallel environments, initiate the discussion, identify problems in the document, find flaws in Ruby implementations if any, suggest what has to be enhanced in Ruby itself and cooperate on adding the enhancements to Ruby implementations. | |
It is not the intention of this effort to introduce high-level concurrency abstractions like actors to the language, but rather to improve low-level concurrency support to add many more concurrency abstractions through gems. | |
For readers and reviewers: Thank you for taking time to read this document and provide feedback or ask questions, both are very valuable. The document is locked against direct editing, but please comment by selecting text and clicking “Insert comment” button, or you can suggest changes by directly editing the text. You can choose to be notified about all comment |
# Dependencies | |
# nginx_lua | |
# lua uuid module (luarocks install uuid) | |
http { | |
# this will be the request id | |
map $host $request_uuid { | |
default ''; | |
} |