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
((function(){ | |
print("creating collection 'textx' and inserting 50 trues, 50 falses, 50 non-existents") | |
db.testx.drop(); | |
db.testx.ensureIndex({deleted:1}); | |
for (var i=0;i<50;i++){ | |
db.testx.insert({i:i,deleted:false}) | |
}; | |
for (var i=0;i<50;i++){ | |
db.testx.insert({i:i,deleted:true}) | |
}; |
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 formatv(fstr : String, args : [CVarArgType]) -> String{ | |
var (res, af, i) = ("", "", 0) | |
for c in fstr { | |
if af == "" { | |
if c == "%"{ | |
af = "%" | |
} else { | |
res += String(c) | |
} | |
} else { |
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 | |
# goswitch is a command line tool for quickly switching Go version. | |
## Usage | |
# Switch to go1.6beta1: | |
# $ goswitch 1.6beta1 | |
# Switch to go1.5.2 | |
# $ goswitch 1.5.2 | |
# List available versions |
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 | |
set -e | |
cd $(dirname "${BASH_SOURCE[0]}") | |
for d in */ ; do | |
if [ -d "$d/.git" ]; then | |
cd "$d" | |
status=$(git status) | |
n=$(basename "`pwd`"); | |
if [[ $status == *"working directory clean"* ]]; then | |
printf "%-20s\x1b[32mCLEAN\x1b[0m\n" $n |
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
# Pull the latest tile38/master branch. | |
# Start Tile38 server in dev mode and very verbose. | |
./tile38-server -dev -vv | |
# From another terminal run use the CLI to insert 3,000,000 random points around the Silicon Valley area. | |
# This will create a collection key "mi:0" with points ids "0" - "2999999". | |
./tile38-cli massinsert 1 3000000 37.10776 -122.67145 38.19502 -121.62775 | |
# Update location for point id "1001". |
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 btree | |
import ( | |
"sort" | |
"testing" | |
) | |
type byInts []Item | |
func (a byInts) Len() int { |
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 ( | |
"flag" | |
"fmt" | |
"log" | |
"time" | |
"github.com/garyburd/redigo/redis" | |
) |
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
/* | |
* SwiftWebSocket (websocket.swift) | |
* | |
* Copyright (C) Josh Baker. All Rights Reserved. | |
* Contact: @tidwall, joshbaker77@gmail.com | |
* | |
* This software may be modified and distributed under the terms | |
* of the MIT license. See the LICENSE file for details. | |
* | |
*/ |
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 gjson | |
import ( | |
"encoding/json" | |
"testing" | |
"github.com/buger/jsonparser" | |
"github.com/tidwall/gjson" | |
) |
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 ( | |
"log" | |
"strings" | |
"sync" | |
"github.com/tidwall/redcon" | |
) |
OlderNewer