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
import ( | |
"flag" | |
"fmt" | |
"net/http" | |
) | |
var ( | |
n = flag.Int("n", 100, "number of GETs to run") | |
s = flag.Bool("s", false, "whether to use HTTPS") | |
c = flag.Bool("c", false, "whether to run concurrently") |
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
[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh | |
#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | |
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh | |
export BROWSER=/usr/bin/google-chrome-stable | |
export EDITOR=/usr/local/bin/vim | |
TERM=xterm | |
case $TERM in | |
xterm*) |
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 ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
data := `{ "spacedValue": "spaced value" }` |
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" | |
type Admin struct { | |
*User | |
Level string | |
} | |
func (a *Admin) Notify() error { |
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
x = "[[1,2,[3]],4]" | |
x.gsub!(/[\[\]]/,'') # Remove the [ and ] from the string. It is required to escape the [ and ] characters | |
puts x.split(",") # Join the string making it an array |
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" | |
"strconv" | |
) | |
func main() { | |
i := 123 | |
t := strconv.Itoa(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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"type": "array", | |
"items": { | |
"minItems": 1, | |
"type": "object", | |
"properties": { | |
"id": { "type": "integer" }, | |
"name": { "type": "string" }, | |
"type": { |
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
swagger: '2.0' | |
info: | |
version: 1.0.9-abcd | |
title: Swagger Sample API | |
description: >- | |
A sample API that uses a petstore as an example to demonstrate features in | |
the swagger-2.0 specification | |
host: my.api.com | |
consumes: | |
- application/json |
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 ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
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
config.action_mailer.default_url_options = { host: 'domain.com.br' } | |
config.action_mailer.delivery_method = :smtp | |
config.action_mailer.perform_deliveries = true | |
config.action_mailer.default charse: 'utf-8' | |
config.action_mailer.smtp_settings = { | |
:address => "smtp.sendgrid.net", | |
:port => 587, # ports 587 and 2525 are also supported with STARTTLS | |
:enable_starttls_auto => false, # detects and uses STARTTLS |