select * from uptime;
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
from jinja2 import Template | |
text = """ | |
hi {{ name|default(other_name) }} | |
""" | |
template = Template(text) | |
template.render(name="foo") # passing variables here to the text template if needed | |
template.render(other_name="bar") |
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
NameVirtualHost answers.example.com:80 | |
<VirtualHost answers.example.com:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/answers | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/answers/> |
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/env zsh | |
function aws-rds-describe() { | |
zparseopts -D -E -A opts -- o: | |
output=${opts[-o]:-"table"} | |
name=${1} | |
query=( | |
"DBInstances[]" | |
".{" |
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 sum(n){ | |
arguments.callee.toString = function(){ | |
return sum; | |
} | |
if(!arguments.callee.sum){ | |
arguments.callee.sum=0 | |
} | |
arguments.callee.sum += n | |
var sum = arguments.callee.sum | |
return arguments.callee |
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
### Keybase proof | |
I hereby claim: | |
* I am jamescarr on github. | |
* I am jamescarr (https://keybase.io/jamescarr) on keybase. | |
* I have a public key ASAiU20sGsNecdzYGqyyswSbo3qJw380XF_-HrTCY1cNUAo | |
To claim this, I am signing this object: |
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
for { | |
select { | |
case m, ok := <-c: | |
if !ok { | |
breakl | |
} | |
handle(m) | |
case <-time.After(1 * time.Minute): | |
fmt.Println("timed out") | |
break |
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
exch := msg.Exchange | |
if val, ok := msg.Headers["x-original-exchange"]; ok { | |
exch = msg.Headers["x-original-exchange"] | |
} |
NewerOlder