Seperate your code into a new structure matching the following:
cmd
`- todo
lib
db.users.find({}).forEach(function(user) { | |
db.users.update({id: user.id}, {$set: { | |
username: user.displayName, | |
lowercaseUsername: user.displayName | |
}}); | |
}); |
#!/bin/bash | |
# | |
# Deploys an instance of talk using docker. | |
# | |
# Usage: | |
# | |
# bash deploy.sh 1.0.0 | |
# | |
# This deploys a version 1.0.0. |
paths: | |
/comments: | |
post: | |
request: | |
body: | |
- Comment | |
response: | |
- Comment | |
/comments/:comment_id/actions: |
type Database interface { | |
Execute(c *mgo.Collection) error | |
} | |
type Result struct{} | |
func MyService(db Database) (*Result, error) { | |
var result Result | |
f := func(c *mgo.Collection) error { |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
const value = "2015-08-04 14:33:21.89115181 -0600 MDT" | |
const layout = "2006-01-02 15:04:05.999999999 -0700 MST" |
func test() { | |
semaphore := make(chan struct{}, internalGoRoutineAsyncMax) | |
for i := 0; i < 1000; i++ { | |
go func() { | |
semaphore <- struct{}{} | |
defer func() { <-semaphore }() | |
// process... | |
}() | |
} |
package main | |
import ( | |
"flag" | |
"strings" | |
"github.com/urfave/cli" | |
) | |
// CLIProvider provides configuration from the cli.Context passed into an |
class Node: | |
def __init__(self, parent, name): | |
self.parent = parent | |
self.name = name | |
def get(self, name): | |
return Node(self, ".".join([self.name, name])) | |
def root(self): | |
node = self |
postgres=# EXPLAIN SELECT name FROM categories WHERE similarity(name, 'cr') > 0.3; | |
QUERY PLAN | |
---------------------------------------------------------------------------- | |
Seq Scan on categories (cost=0.00..208.55 rows=2323 width=9) | |
Filter: (similarity((name)::text, 'cr'::text) > '0.3'::double precision) | |
(2 rows) |