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
require "socket" | |
socket = TCPSocket.open("localhost", 6666) | |
loop do | |
input = gets.chomp #Ask client for command | |
socket.puts input # Send command to server | |
line = socket.gets #Get server response | |
puts line |
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
c = Savon.client(wsdl: "WSDL_URL", log: true, log_level: :debug) do | |
convert_request_keys_to :none | |
pretty_print_xml :true | |
end |
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 ( | |
"encoding/base64" | |
"net/http" | |
"strings" | |
) | |
type handler func(w http.ResponseWriter, r *http.Request) |
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
git config --global url."[email protected]:".insteadOf "https://github.com/" |
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
func execute(cmd *Cmd, conn ircConnection) { | |
done := make(chan bool, len(list)) | |
for k, v := range list { | |
cmdName := k | |
cmdFunc := v | |
go func() { | |
result := cmdFunc(cmd) | |
conn.Privmsg(cmd.Channel, result) | |
done <- true |
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
# Rodar CGI - arquivos precisam estar em uma pasta cgi-bin | |
python -m http.server --cgi |
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
@echo off | |
if %1!==! goto help | |
if %1!==/?! goto help | |
echo. | |
echo Pinging %1.1 - %1.254 (this will take a little time). | |
echo. | |
for /l %%p in (1,1,254) do ping %1.%%p -n 1 -w 10 | find /i "resposta" | |
echo. | |
echo Done. | |
echo. |
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
//execute after the document is loaded | |
jQuery(document).ready(function() { | |
$("span").text("$100") | |
}); | |
//select element by ID | |
$("#vacation"); | |
//select element by class | |
$(".america"); |
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
type Data struct { | |
Cidade model.Cidade | |
Erros template.HTML | |
} | |
func Handler(w http.ResponseWriter, r *http.Request) { | |
data := new(Data) | |
if r.Method == "POST" { | |
r.ParseForm() | |
decoder.Decode(&data.Cidade, r.Form) |
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
type Data struct { | |
PostData url.Values | |
Errors string | |
} | |
func Handler(w http.ResponseWriter, r *http.Request) { | |
data := new(Data) | |
if r.Method == "POST" { | |
err := r.ParseForm() | |
if err != nil { |
NewerOlder