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
name: Dependabot Go modules | |
on: | |
pull_request: | |
paths: | |
- "go.mod" | |
- "go.sum" | |
jobs: | |
dependabot: |
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
TOOLS := swiftformat protoc-gen-swift protoc-gen-grpc-swift | |
tools: $(TOOLS) | |
$(TOOLS): Package.swift Package.resolved | |
swift build -c release --product $@ | |
cp $$(swift build -c release --show-bin-path)/$@ ~/bin/ |
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
# To make a sandwich: | |
# $ make <track> sandwich | |
# e.g.: make alpha sandwich | |
# | |
# This works by rewriting MAKECMDGOALS by stripping the argument from the list | |
# and recursively calling make with a variable assignment (e.g. track=alpha) | |
# and the remaining goal(s). | |
# | |
# The ifeq below ensures that the “real” goals aren’t executed unless the | |
# track variable is set. The @: command silences the “Nothing to be done” |
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
// Thanks https://amorten.com/blog/2017/ios-bluetooth-and-microphone-input/ | |
func configure() { | |
// ... | |
let session = AVAudioSession.sharedInstance() | |
let sampleRate = 48000.0 | |
do { |
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 syncmap | |
import ( | |
"sync" | |
) | |
// Map wraps a sync.Map to enable idempotent deferred creation of new values. | |
type Map struct { | |
sync.Map | |
} |
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
DEL example.com | |
HSET example.com status reserved | |
EVAL "return redis.call('TTL',KEYS[1])>0 or redis.call('EXPIRE',KEYS[1],ARGV[1])" 1 example.com 111111 | |
HGETALL example.com | |
TTL example.com | |
HSET example.com comment IANA | |
EVAL "return redis.call('TTL',KEYS[1])>0 or redis.call('EXPIRE',KEYS[1],ARGV[1])" 1 example.com 222222 |
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
version: 2 | |
jobs: | |
build: | |
working_directory: ~/app | |
docker: | |
- image: circleci/node:8.7-browsers | |
environment: | |
NODE_ENV: production | |
steps: | |
- checkout |
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
import * as admin from 'firebase-admin' | |
import * as functions from 'firebase-functions' | |
admin.initializeApp(functions.config().firebase) | |
const db = admin.firestore() | |
async function writeIntegerVersion(event) { | |
const ref = event.data.ref | |
if (ref.path.indexOf('/_versions/') >= 0) { | |
return false |
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
<template> | |
<div class="container"> | |
<h1>Flex Test</h1> | |
<div class="content" @click="show = (show + 1) % 3"> | |
<transition name="fade"> | |
<div v-if="show == 0" class="foo"> | |
<h2>Foo</h2> | |
<p>One paragraph.</p> | |
</div> | |
</transition> |
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
import url from 'url' | |
import qs from 'qs' | |
export default function (ctx) { | |
fixRedirect(ctx) | |
const { route, redirect } = ctx | |
const { path, query } = route | |
// Redirect trailing slashes, preserving query string: /foo/ -> /foo | |
if (path.length > 1 && path.slice(-1) === '/') { |