Skip to content

Instantly share code, notes, and snippets.

import {HttpClient} from 'aurelia-fetch-client'
import {Authentication} from './authentication';
import {BaseConfig} from './baseConfig'
import {inject} from 'aurelia-framework';
import {Storage} from './storage';
@inject(HttpClient, Authentication, Storage, BaseConfig)
export class FetchConfig {
constructor(httpClient, authService, storage, config){
this.httpClient = httpClient;
@vbauerster
vbauerster / introrx.md
Created December 11, 2015 10:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
imap <expr><TAB>
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ emmet#getFileType()=='html' && match(getline('.'), '<.*>')<0 ? emmet#expandAbbrIntelligent("\<plug>(emmet-move-next)") :
\ pumvisible() ? "\<C-n>" :
\ "\<TAB>"
// http://www.sensefulsolutions.com/2012/01/viewing-chrome-cache-easy-way.html
(function() {
var preTags = document.getElementsByTagName('pre');
var preWithHeaderInfo = preTags[0];
var preWithContent = preTags[2];
var lines = preWithContent.textContent.split('\n');
// get data about the formatting (changes between different versions of chrome)
var rgx = /^(0{8}:\s+)([0-9a-f]{2}\s+)[0-9a-f]{2}/m;
@vbauerster
vbauerster / main.go
Last active April 8, 2018 02:27
Diff btw chan size 0 and 1
package main
import (
"fmt"
"time"
)
func main() {
// c := make(chan struct{}, 1)
c := make(chan struct{})
package main
import "fmt"
type person struct {
Name string
Age int
}
func main() {
package main
import (
"flag"
"fmt"
"log"
"net/http"
"net/url"
"os"
"strings"
package main
import (
"fmt"
"sync"
)
func main() {
var wg sync.WaitGroup
done := make(chan struct{})
package main
import (
"fmt"
"time"
)
func main() {
inch := make(chan int)
outch := make(chan int)
/* https://tour.golang.org/flowcontrol/8
Exercise: Loops and Functions
As a simple way to play with functions and loops, implement the square root
function using Newton's method.
In this case, Newton's method is to approximate Sqrt(x) by picking a starting
point z and then repeating: z - (z*z-x)/(2*z)
Original formula: https://tour.golang.org/content/img/newton.png