| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix | |
| ;; and optionally can refer functions to the current ns. | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; | |
| ;; * :refer-clojure affects availability of built-in (clojure.core) | |
| ;; functions. |
| #variation of http://urbangiraffe.com/2011/08/13/remote-editing-with-sublime-text-2/ that adds creating new folders remotely. | |
| import sublime_plugin, os | |
| class RemoteEdit(sublime_plugin.EventListener): | |
| def on_post_save(self, view): | |
| remote = { "/Users/leto/work/project": ["/usr/bin/scp", None, "user@server", "root_remote_path_like ~/project/", None] } | |
| for dirname, target in remote.iteritems(): | |
| if view.file_name().startswith( dirname ): |
| package main | |
| import( | |
| "net/http" | |
| "fmt" | |
| ) | |
| func main() { | |
| var ( |
| interfaces { | |
| ethernet eth0 { | |
| address x.x.x.50/30 | |
| duplex auto | |
| hw-id 00:0c:29:8e:f1:58 | |
| smp_affinity auto | |
| speed auto | |
| } | |
| ethernet eth2 { | |
| address 172.31.1.50/16 |
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Foo struct { | |
| FirstName string `tag_name:"tag 1"` | |
| LastName string `tag_name:"tag 2"` |
| func readLine(path string) { | |
| inFile, _ := os.Open(path) | |
| defer inFile.Close() | |
| scanner := bufio.NewScanner(inFile) | |
| scanner.Split(bufio.ScanLines) | |
| for scanner.Scan() { | |
| fmt.Println(scanner.Text()) | |
| } | |
| } |
| open System | |
| open Neo4jClient | |
| open System.Linq | |
| [<CLIMutable>] | |
| type Person = { Name:string; Twitter:string } | |
| [<CLIMutable>] | |
| type Knows = { How:string } |
| package main | |
| import ( | |
| "encoding/base64" | |
| "net/http" | |
| "strings" | |
| ) | |
| type handler func(w http.ResponseWriter, r *http.Request) |
I was using Boot2Docker 1.2 (OSX) and wanted to use volume for MongoDB. First nothing was happening because 1.2 has no Guest Additions and volumes don't work. There is a workaround by making a boot2docker.iso from master which has Guest Additions.
But then Mongo didn't like putting data on VirtualBox's shared folders:
[initandlisten] WARNING: This file system is not supported. For further information see:
[initandlisten] http://dochub.mongodb.org/core/unsupported-filesystems