There are actually two different ways of achieving concurrency in Go:
Nice format:
import (
"fmt"
)
var _ = require('underscore'); | |
function printPrototypeChain(instance, asArray) { | |
var chain = [] | |
while (instance = Object.getPrototypeOf(instance)) { | |
var name = instance.constructor.toString().match(/f.+n (.+)\(/); | |
chain.push(name && name[1]? name[1] : "(anonymous function expression)") | |
} | |
return asArray? chain : chain.join(" -> ") | |
} |
import bpython | |
import inspect | |
def interact(): | |
""" | |
Just run interace() anywhere in your code, and you'll get a sweet | |
interactive bpython interpreter with access to the scope of where you | |
called it. Great for investigating new API's. | |
""" | |
try: |
{ | |
"variables": { | |
"salt_role": "common" | |
}, | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"scripts": [ | |
"scripts/ec2-ephemeral-tmp.sh" | |
], |
// We assume that this is running in an iframe which loads a page from a domain | |
// that is specific to where your widget is served from. This means that for | |
// browsers that support 3rd party cookies in iframes, the cookie will be set | |
// on this domain, and for those who don't, localStorage will be used instead. | |
ga('create', 'UA-XXXX-Y', { | |
'storage': 'none', | |
'clientId', getPersistentVisitorId() | |
}); |
/* | |
* @getPersistentVisitorId: Generates a unique visitor ID that is persisted between visits. | |
* | |
* We assume we're in an iframe, so for Safari users we use localStorage, | |
* and for everyone we use local domain cookies. | |
*/ | |
var getPersistentVisitorId = (function() { | |
var key = 'silp_visitorid'; | |
var method = allowsThirdPartyCookies() ? 'cookie' : 'localStorage'; | |
var persistor = { |
#!/bin/bash | |
# Examples: | |
# | |
# When's the damn thing online? | |
# | |
# $ retry.sh ssh [email protected] | |
# | |
# When's internet back? | |
# |
## lib.sls | |
# Shorthand macro for getting pillar data | |
{% macro p(key, default='') -%} | |
{{ salt['pillar.get'](key, default) }} | |
{%- endmacro %} | |
## Usage | |
{% from 'lib.sls' import p with context %} | |
{{ p('git:url', '[email protected]') }} |
{ | |
graphitePort: 2003, | |
graphiteHost: "localhost", | |
port: 8125, | |
backends: [ "./backends/graphite" ] | |
} |