This file contains 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 coalescing | |
import ( | |
"context" | |
"sync/atomic" | |
) | |
func Q(ctx context.Context, bufferSize int, fn func()) func() { | |
var ( | |
q = make(chan int64, bufferSize) |
This file contains 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
func select4(ctx context.Context, chanz []chan interface{}, res chan *r, r *r, i int) { | |
select { | |
case r.v, r.ok = <-chanz[0]: | |
r.i = i + 0 | |
res <- r | |
case r.v, r.ok = <-chanz[1]: | |
r.i = i + 1 | |
res <- r | |
case r.v, r.ok = <-chanz[2]: | |
r.i = i + 2 |
This file contains 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 --debugger | |
set -e | |
BRANCH="master" | |
if grep -q BCM2708 /proc/cpuinfo; then | |
echo "RPI BUILD!" | |
RPI="1" | |
fi | |
[ -n "$1" ] && BRANCH=$1 |
This file contains 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 | |
set -e | |
set -u | |
function usage() { | |
set -e | |
cat <<EOM | |
##### ecs-deploy ##### |
This file contains 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 com.j256.ormlite.dao.Dao; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.function.Function; | |
public class QueueDBWriter<T, E> { | |
This file contains 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'; | |
/** | |
* @ngdoc function | |
* @name myApp.directive:datePicker | |
* @description | |
* # datePicker | |
* Directive of the myApp | |
*/ | |
angular.module('myApp') |