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 | |
import ( | |
"fmt" | |
) | |
type Loc struct { X, Y int } | |
func (l Loc) Neighbors() []Loc { | |
neighbors := make([]Loc, 0, 8) |
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
const { google } = require('googleapis'); | |
const config = { | |
auth_scopes: [ | |
'https://www.googleapis.com/auth/drive.activity.readonly', | |
], | |
} | |
async function activity_for({ ancestorName, itemName }) { |
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 matcher_test | |
import ( | |
"fmt" | |
"github.com/golang/mock/gomock" | |
. "github.com/onsi/ginkgo" | |
. "github.com/onsi/gomega" | |
) |
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 | |
/// | |
/// Genderated code: | |
/// | |
type GeneratedQueries interface { | |
A() error | |
B() error | |
} |
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
const fs = require('fs') | |
const { google } = require('googleapis') | |
const http = require('http') | |
const open = require('open') | |
const { promisify } = require('util') | |
const config = { | |
auth_scopes: [ | |
'https://www.googleapis.com/auth/drive.readonly', | |
], |
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 | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
_ "image/jpeg" | |
"os" | |
) |
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
#!/bin/bash | |
# Heavy Metal Traffic Control (HMTC) | |
# Erik Elmore 2005-06-11 | |
# Based on concepts from WonderShaper | |
### Configuration ### | |
# Set this to your WAN interface | |
INTERFACE=eth0 | |
# Upstream Parameters # |
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 bash | |
# Write paths to keys to autoload in ~/.autoload-ssh-keys | |
env=~/.ssh/agent.env | |
autoload=~/.autoload-ssh-keys | |
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } | |
agent_start () { |
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
#!/bin/bash | |
commit='%C(dim yellow)%h' | |
time='%C(bold yellow)%ad' | |
author='%C(dim cyan)%an' | |
refs='%C(auto)%d' | |
subject='%C(dim white)%s' | |
fmt="$commit $time $author ${refs}%n${subject}%n" | |
git config --global alias.dag "log --graph --date=relative --pretty=format:'${fmt}'" |
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
"use strict"; | |
const {Readable} = require('readable-stream'); | |
const {S3} = require('aws-sdk'); | |
// Convert the given S3::listObjectsV2 request to a Readable stream | |
// req should be an un-sent S3::listObjectsV2() request | |
// opts are typical stream options. Object mode is required. | |
function s3_list_stream( req, opts ){ | |
opts = Object.assign({}, opts, {read, objectMode: true}); | |
const stream = new Readable(opts); |
NewerOlder