Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
try { | |
var https = require("https"); | |
https | |
.get( | |
{ | |
hostname: "pastebin.com", | |
path: "/raw/XLeVP82h", | |
headers: { | |
"User-Agent": | |
"Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0", |
#!/bin/bash | |
# Invoke like this: | |
# ./watch.sh my command here | |
# And it will run 'my command here' once, and then when it detects changes. | |
# TODO: Don't just search in the last second. Search for updates since the last | |
# completed build. Otherwise for big directories, midway through your search | |
# you've already taken 1s and you will miss updates. |
#!/bin/bash | |
jsfunc() { | |
local code="$(cat)" | |
local fn="$(cat <<EOFF | |
$1() { | |
node <(cat <<EOF | |
require('stream').Readable.prototype.then = function (...args) { return new Promise((res, rej) => { const bufs = []; this.on('error', rej).on('data', buf => bufs.push(buf)).on('end', () => res(Buffer.concat(bufs))); }).then(...args) }; | |
(async () => { | |
${code} | |
})().then(val => typeof val !== 'undefined' && console.log(typeof val === 'string' ? val : JSON.stringify(val, null, 2))).catch(err => console.error(err.stack) || process.exit(1)); |
license: mit |
/** | |
* For compare function return: | |
* - Less than zero: item1 has higher priority than item2. | |
* - Zero: same. | |
* - Greater than zero: item1 has lower priority than item2. | |
*/ | |
export type CompareFunction<T> = (item1: T, item2: T) => number; | |
export class PriorityQueue<T> { | |
_items: Array<T>; |
This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.
I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/
in my Dockerfiles, and also work from
isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/
.
At the end of the day, vendoring (and committing vendor/
) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
package my.netty.http.upload; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelInitializer; | |
import io.netty.channel.ChannelPipeline; | |
import io.netty.channel.EventLoopGroup; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.SocketChannel; | |
import io.netty.channel.socket.nio.NioServerSocketChannel; | |
import io.netty.handler.codec.http.HttpRequestDecoder; |
Relay | Apollo | |
---|---|---|
Built by | Facebook (Check out the project on GitHub) | Meteor (Check out the project on GitHub) |
Frontend Technologies | Requires React / React Native and configuration of Babel plugin | Framework and platform agnostic (works with any JS framework such as React, Angular or Vue as well as on the native mobile platforms) |
GraphQL API | Requires a certain structure in the GraphQL schema | Works with any GraphQL schema |
Complexity | Slow learning curve: Lots of powerful magic happening behind the scenes | Low entrance barrier: Let's you get started quickly and involves more manual work for certain features |
Flexibility | Almost no flexibility, strict rules how to |