This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Decide on your cache-busting strategy. In this example, we use the current timestamp, which will | |
* force a change every time the app is visited, but not every time the partial is loaded within a | |
* visit. Even better would be to use a hash of the file's contents to ensure that the file is always | |
* reloaded when the file changes and never reloaded when it isn't. | |
*/ | |
var cacheBustSuffix = Date.now(); | |
// Optionally, expose the cache busting value as a constant so other parts of your app can use it. | |
ngModule.constant("cacheBustSuffix", cacheBustSuffix); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Let's say we have a collaborater with a 'show' function. The instance under test is going to invoke | |
* this function and pass two arguments: 'parameters' and a callback function. We often want to either | |
* do some inspection on the 'parameters' to make sure they're right, or invoke the callback to verify | |
* behavior after the callback, such as after an XHR returns. | |
*/ | |
describe("someFunctionThatInvokesOurCollaborator", function () { | |
var instance, | |
TemplateResource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tools environment: GOPATH=C:\Go;C:\tinygo | |
Installing 18 tools at C:\Go\bin;C:\tinygo\bin in module mode. | |
gocode | |
gopkgs | |
go-outline | |
go-symbols | |
guru | |
gorename | |
gotests | |
gomodifytags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// F5PoolSyncer is responsible for ensuring state on the F5 BigIP LTM. It is the glue | |
// that hides and abstracts the LTM from the rest of the code. | |
type F5PoolSyncer interface { | |
EnsurePoolPresent(k8sPool *bigipv1beta1.Pool) (*SyncResult, *bigip.Pool, error) | |
EnsurePoolAbsent(k8sPool *bigipv1beta1.Pool) (*SyncResult, error) | |
EnsureMembersPresent(k8sPool *bigipv1beta1.Pool, endpoints *corev1.Endpoints) (result *SyncResult, err error) | |
} | |
// realPoolSyncer is a concrete implementation of the PoolSyncer interface | |
// TODO this naming is awful; change it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
// We used an import alias when Logrus replaced | |
// the standard logging library a while back | |
log "github.com/sirupsen/logrus" | |
// Two scheme packages | |
"k8s.io/client-go/kubernetes/scheme" | |
myscheme "github.mycompany.com/product-engineering/my-project/pkg/client/clientset/versioned/scheme" | |
// So many v1 packages! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your keymap | |
# | |
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors | |
# to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# | |
# Here's an example taken from Atom's built-in keymap: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util') | |
var async = require('async') | |
var Cylon = require('cylon') | |
Cylon.robot({ | |
connections: { | |
edison: { | |
adaptor: 'intel-iot', | |
i2cPort: 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert') | |
function* createIncrementingSequence(increment) { | |
let nextValue = 0 | |
for (let i = 0; i < maxIterations; i++) { | |
// ↙ 'yield' each value in the iteration. | |
yield nextValue | |
nextValue += increment | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert') | |
const co = require('co') | |
return co(function* () { | |
let a = yield getDataAsync() | |
let b = yield getDataAsync() | |
let c = yield getDataAsync() | |
let actual = yield averageAsync([a, b, c]) | |
let expected = (a + b + c) / 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let promises = [getDataAsync(), getDataAsync(), getDataAsync()] | |
resolveAndHandleChainOfPromises(promises) |
NewerOlder