This file contains hidden or 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
package sqlite | |
import ( | |
"fmt" | |
"os" | |
"sync" | |
"time" | |
"github.com/golang/glog" | |
"github.com/jinzhu/gorm" |
This file contains hidden or 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
FROM golang:1.8 | |
MAINTAINER [email protected] | |
RUN mkdir -p /go/src/github.com/maxwellforest/onefill | |
WORKDIR /go/src/github.com/maxwellforest/onefill | |
COPY . /go/src/github.com/maxwellforest/onefill | |
RUN go get -u github.com/golang/dep/cmd/dep | |
RUN dep ensure |
This file contains hidden or 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
#!/usr/bin/env node | |
let success = 'success'; | |
let failure = 'failure'; | |
var callCount = 0; | |
async function runSyncAsync() { | |
console.log('runSyncAsync'); | |
let resCallCount = 0; | |
let success = 4; |
This file contains hidden or 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
#!/usr/bin/env node | |
let success = 'success'; | |
let failure = 'failure'; | |
async function runEngine() { | |
console.log('runEngine'); | |
var report = await run1(); | |
return report; // Important! Otherwise it will return some bizarre object | |
// { '0': {}, |
This file contains hidden or 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
static func compressVideo(inputURL: URL, outputURL: URL) -> Promise<URL> { | |
let videoAsset = AVURLAsset(url: inputURL, options: nil) | |
return Promise<URL> { fulfill, reject in | |
guard let videoTrack = videoAsset.tracks(withMediaType: AVMediaTypeVideo).first else { | |
reject(AVServiceError.noDataFound) | |
return | |
} | |
guard let audioTrack = videoAsset.tracks(withMediaType: AVMediaTypeAudio).first else { | |
reject(AVServiceError.noDataFound) | |
return |
This file contains hidden or 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
// TODO Copy over all support directories as well | |
// TODO Replace returning promises with async / await | |
// TODO Decide if it's worth making an extension to Vue.js | |
// TODO Decide how Markdown will interact with custom Vue.js components | |
// Global map of Markdown syntax to Vue.js components on a page-by-page basis with sane defaults? | |
// Unit testing, project setup and maintenance as an open source concern | |
#!/usr/bin/env node | |
var fs = require('fs'); |
This file contains hidden or 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
package main | |
// Simple static file server in go | |
// Usage: | |
// -p="6969": port to serve on | |
// -d="./static": the directory of static files to host | |
import ( | |
"flag" | |
"log" |
This file contains hidden or 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
term := make(chan os.Signal, 1) | |
signal.Notify(term, os.Interrupt, syscall.SIGTERM) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>A File Upload Demo</title> | |
<style> | |
html, body { | |
height: 100%; | |
margin: 0; | |
} | |
body { |
This file contains hidden or 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
global: | |
scrape_interval: 15s # By default, scrape targets every 15 seconds. | |
# Attach these labels to any time series or alerts when communicating with | |
# external systems (federation, remote storage, Alertmanager). | |
external_labels: | |
monitor: 'codelab-monitor' | |
alerting: | |
receivers: | |
- name: "slack" | |
slack_configs: |