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 main | |
import ( | |
"bytes" | |
"database/sql" | |
"flag" | |
"html/template" | |
"strconv" | |
"strings" | |
"testing" |
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 main | |
// Run this with: | |
// $ go test -count=1 -race -timeout=2s -dsn=postgresql://... . | |
import ( | |
"context" | |
"database/sql" | |
"flag" | |
"strconv" |
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 main | |
import ( | |
"fmt" | |
xdg "github.com/twpayne/go-xdg" | |
) | |
func main() { | |
bds, err := xdg.NewBaseDirectorySpecification() |
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 argbench | |
import ( | |
"testing" | |
) | |
// n limits the size of the constructed arrays, to prevent the benchmarks from | |
// measuring memory bandwidth instead of performance. | |
const n = 1024 |
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 argbench | |
import ( | |
"testing" | |
) | |
// n limits the size of the constructed arrays, to prevent the benchmarks from | |
// measuring memory bandwidth instead of performance. | |
const n = 1024 |
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/python | |
import glob | |
import re | |
import os | |
import sys | |
def assemble_paths(paths): | |
"""Assemble multiple files together into a main sketch. paths is a list |
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
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* on Mac OS X sizeof(int) < sizeof(int *) so make sure we use a large enough integer! */ | |
typedef int64_t integer_t; | |
typedef struct { | |
int value; | |
integer_t nextprev; |
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
# Configs | |
config defaultToCurrentScreen true | |
config checkDefaultsOnLoad true | |
# Position Aliases | |
alias one move screenOriginX;screenOriginY screenSizeX;screenSizeY |
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 Data.Bits ((.|.)) | |
import qualified Data.Map as M | |
import System.Exit | |
import XMonad hiding (Tall) | |
import XMonad.Actions.FocusNth | |
import XMonad.Actions.Search | |
import XMonad.Actions.Submap | |
import XMonad.Config.Gnome | |
import XMonad.Core | |
import XMonad.Hooks.ManageDocks |
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 re | |
def valid(awb): | |
m = re.match('\d{3}(?P<serial>\d{7})(?P<check>\d)\Z', awb) | |
return m and int(m.group('serial')) % 7 == int(m.group('check')) |
NewerOlder