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
| file, err := ms.DB(database).GridFS("media").Open(r.URL.Path[1:]) | |
| if err == nil { | |
| w.Header().Add("Accept-Ranges", "bytes") | |
| w.Header().Add("Content-Type", file.ContentType()) | |
| bytes := r.Header.Get("Range") | |
| if bytes != "" { | |
| rs := bytes[strings.LastIndex(bytes, "=")+1 : strings.Index(bytes, "-")] | |
| re := bytes[strings.LastIndex(bytes, "-")+1:] |
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 api | |
| import ( | |
| "io" | |
| "os" | |
| "os/exec" | |
| "strconv" | |
| "sync" | |
| "time" |
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
| [00m | |
| [38;5;35m▄[48;5;35;38;5;35m▄[48;5;35;38;5;35m▄[49;38;5;35m▄[38;5;35m▄[48;5;35;38;5;35m▄[48;5;35;38;5;35m▄[49;39m[00m | |
| [48;5;35;38;5;35m▄[48;5;35;38;5;35m▄[48;5;231;38;5;35m▄[48;5;232;38;5;35m▄[48;5;35;38;5;35m▄[48;5;231;38;5;35m▄[48;5;16;38;5;35m▄[49;39m[00m | |
| [48;5;62;38;5;62m▄[48;5;35;38;5;35m▄[48;5;130;38;5;35m▄[48;5;130m▄▄[38;5;35m▄[49;38;5;130m▀[39m[00m | |
| [38;5;62m▀[38;5;62m▀[38;5;62m▀▀▀[38;5;62m▀[39m [00m | |
| [00m |
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 api | |
| import ( | |
| "net/http" | |
| "git.ameoto.com/Ameoto/auth/server/auth" | |
| "git.ameoto.com/Ameoto/platform" | |
| "git.ameoto.com/Ameoto/platform/conf" | |
| "git.ameoto.com/webcogs/accounting/model" | |
| log "github.com/Sirupsen/logrus" |
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
| { | |
| "_id" : ObjectId("5725acd12305804fe593944c"), | |
| "name" : "Jeffrey Jenner", | |
| "email" : "thetooth@ameoto.com", | |
| "password" : "$2a$10$trW0YEsrY3Pr/JHfgQ0mbOJoZVv0cyvYdri8Qfdsza3IiLnXmvbDK", | |
| "address" : "317 Musgrave Rd Coopers Plains", | |
| "isadmin" : true, | |
| "isapproved" : true, | |
| "containers" : [ | |
| { |
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
| chip@chip:~$ sudo hwtest | |
| [sudo] password for chip: | |
| ############################################################ | |
| # [ CHIP HW TEST ] # | |
| ############################################################ | |
| # Turn on wlan0...OK |
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
| // Handle a subject | |
| // Warning: Uses parametric function wizardy and WILL crash | |
| func (a *Server) Handle(subj string, f interface{}) error { | |
| _, err := a.sc.Subscribe(a.toSubj(subj), func(m *nats.Msg) { | |
| // Get function and paramater values | |
| vf := reflect.ValueOf(f) | |
| req := reflect.New(vf.Type().In(0)) | |
| // Decode payload | |
| if err := msgpack.Unmarshal(m.Data, req.Interface()); err != nil { |
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
| The local commuter railroad services a number of towns in Kiwiland. Because of monetary concerns, all of the tracks are 'one-way’. That is, a route from Kaitaia to Invercargill does not imply the existence of a route from Invercargill to Kaitaia. In fact, even if both of these routes do happen to exist, they are distinct and are not necessarily the same distance! | |
| The purpose of this problem is to help the railroad provide its customers with information about the routes. In particular, you will compute the distance along a certain route, the number of different routes between two towns, and the shortest route between two towns. | |
| Input: A directed graph where a node represents a town and an edge represents a route between two towns. The weighting of the edge represents the distance between the two towns. A given route will never appear more than once, and for a given route, the starting and ending town will not be the same town. | |
| Output: For test input 1 through 5, if no such route exists, output 'NO SUCH ROU |
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
| // NUCLEO-F401RE DMA Driven PWM - Not good for school or work assignments. | |
| // Copyright (C) 2015 sourcer32@gmail.com, All Rights Reserved | |
| #include "stm32f4xx.h" | |
| #define PWM_ELEMENTS 100 | |
| const u32 PWM_Buffer[PWM_ELEMENTS] = { // Sine Table | |
| 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 50, 53, 56, | |
| 58, 61, 63, 66, 68, 70, 72, 75, 77, 79, 80, 82, 84, 86, 87, 89, 90, 91, 92, 94, |
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
| --- | |
| - hosts: localhost | |
| connection: local | |
| gather_facts: False | |
| tasks: | |
| - name: Build client | |
| shell: "GOARM=7 GOARCH=arm GOOS=linux go build -v -i -o client cmd/client/main.go" | |
| register: build | |
| - debug: var=build.stderr |