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
my notes on django static assets during development. This is not related to collectstatic or configuring the webserver: | |
1) created new /static/ directory under 'mysite' | |
2) put some stuff in there... css, images | |
How to include in templates: | |
1) Using the {{STATIC_URL}} seting | |
--requires Zero additional configuration unlike {% static "blah.css" %} |
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
direct_to_template, \{'template':(.*?)} | |
TemplateView.as_view(template_name=$1) | |
redirect_to, \{'url': (.*?)} | |
RedirectView.as_view(url=$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
use local | |
cfg = db.system.replset.findOne() | |
cfg.members.forEach( function(m) { var tmp = m.host.replace(27018,12345); print(tmp); m.host = tmp; } ) | |
cfg | |
db.system.replset.update({"_id":cfg['_id']}, cfg) | |
db.system.replset.findOne() |
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
In this case, in AWS Linux: | |
yum-config-manager --enable epel | |
yum install -y p7ip | |
cp /usr/bin/7za /usr/bin/7z | |
7z |
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 ( | |
"code.google.com/p/go-tour/pic" | |
"math" | |
) | |
func Pic(dx, dy int) [][]uint8 { | |
p := make([][] uint8, dy) | |
for i :=0; i < dy; i++ { |
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 ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
m := make(map [string] int) | |
for _, v := range strings.Fields(s) { |
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" | |
"net/http" | |
) | |
type String string | |
type Hello struct { | |
Greeting string |
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 ( | |
"io" | |
"os" | |
"strings" | |
) | |
type rot13Reader struct { | |
r io.Reader |
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
worker-11 | |
at java.lang.String.intern()Ljava/lang/String; (Native Method) | |
at clojure.lang.Symbol.intern(Ljava/lang/String;)Lclojure/lang/Symbol; (Symbol.java:62) | |
at clojure.lang.Keyword.intern(Ljava/lang/String;)Lclojure/lang/Keyword; (Keyword.java:53) | |
at clojure.core$keyword.invoke(Ljava/lang/Object;)Ljava/lang/Object; (core.clj:574) | |
at cfpb.qu.data$get_data_table$fn__4180$fn__4181.invoke(Ljava/lang/Object;)Ljava/lang/Object; (data.clj:176) | |
at clojure.core$map$fn__4207.invoke()Ljava/lang/Object; (core.clj:2485) | |
at clojure.lang.LazySeq.sval()Ljava/lang/Object; (LazySeq.java:42) | |
at clojure.lang.LazySeq.seq()Lclojure/lang/ISeq; (LazySeq.java:60) | |
at clojure.lang.ChunkedCons.chunkedNext()Lclojure/lang/ISeq; (ChunkedCons.java:59) |
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/sh | |
if [[ $1 == *.go ]] | |
then | |
goimports -w $1 | |
fi |