Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Picking the right architecture = Picking the right battles + Managing trade-offs
| // poller.go | |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "time" |
| var Comment = {} | |
| Comment.store = Store('Comment') | |
| Comment.fetchForPost = function (postId) { | |
| return m.request({ method: 'GET', url: '/api/post/' + postId + '/comments' }) | |
| .then(Comment.store.syncAll) | |
| } |
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |
A running example of the code from:
This gist creates a working example from blog post, and a alternate example using simple worker pool.
TLDR: if you want simple and controlled concurrency use a worker pool.
| // Remember to @import WebKit at the top of the class | |
| // Javascript that disables pinch-to-zoom by inserting the HTML viewport meta tag into <head> | |
| let source: NSString = "var meta = document.createElement('meta');" + | |
| "meta.name = 'viewport';" + | |
| "meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';" + | |
| "var head = document.getElementsByTagName('head')[0];" + | |
| "head.appendChild(meta);"; | |
| let script: WKUserScript = WKUserScript(source: source, injectionTime: .AtDocumentEnd, forMainFrameOnly: true) |
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes: