... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| The MIT License (MIT) | |
| Copyright (c) 2014 Tomas Kafka | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| <?php | |
| /* | |
| Backup script for trakt.tv (API v2). | |
| Live demo: https://darekkay.com/blog/trakt-tv-backup/ | |
| */ | |
| // create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app | |
| $apikey = "CLIENT_API_KEY"; |
To make it and easier for everyone, and save us some time please prepare a couple of simple things beforehand. Coming unprepared can cause delays and you might miss the whole workshop because the internet is not fast enough for everyone to download the requirements.
| // By Janaka Jayasuriya, @pinkydoe | |
| // Original By Jamie Chapman, @chappers57 | |
| // License: open, do as you wish, just don't blame me if stuff breaks ;-) | |
| package us.peripl.app.util; | |
| import com.parse.ParseFile; | |
| import com.parse.ParseGeoPoint; | |
| import com.parse.ParseObject; |
| /** | |
| * ArcUtils.java | |
| * | |
| * Copyright (c) 2014 BioWink GmbH. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| var http = require('http'), | |
| url = require('url'), | |
| fs = require('fs'); | |
| var port = 9000; | |
| var httpServer = http.createServer(function(request, response) { | |
| var parsedUrl = url.parse(request.url); | |
| var requestData; | |
| var requestOpts = { |
| var http = require('http'), | |
| url = require('url'), | |
| fs = require('fs'); | |
| var port = 9000; | |
| var httpServer = http.createServer(function(request, response) { | |
| var parsedUrl = url.parse(request.url); | |
| var requestData; | |
| var requestOpts = { |
| var r = R.player, oVol = r.volume(), tf = r._onTrackFinished, ar = r._onAudioReady, n = r._next; | |
| r._onTrackFinished = function() { | |
| return .001 !== r.volume() && (oVol = r.volume()), r.volume(.001), tf.apply(this, arguments); | |
| }; | |
| r._onAudioReady = function() { | |
| return r.playingAd() || r.volume(oVol), ar.apply(this, arguments); | |
| }; |
| // Example usage: | |
| // deepPopulate(blogPost, "comments comments._creator comments._creator.blogposts", {sort:{title:-1}}, callback); | |
| // Note that the options get passed at *every* level! | |
| // Also note that you must populate the shallower documents before the deeper ones. | |
| function deepPopulate(doc, pathListString, options, callback) { | |
| var listOfPathsToPopulate = pathListString.split(" "); | |
| function doNext() { | |
| if (listOfPathsToPopulate.length == 0) { | |
| // Now all the things underneath the original doc should be populated. Thanks mongoose! | |
| callback(null,doc); |