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 space | |
import "math" | |
type Planet string | |
var orbitalPeriod = map[string]float64{ | |
"Mercury": 0.2408467, | |
"Venus": 0.61519726, | |
"Earth": 1.0, |
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
curl -F "file=@input.jpg" http://localhost:8080/upload --output result.jpg |
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
curl 'https://s.id/api/public/link/shorten' -H 'User-Agent: Chrome/62.0 (BSD x86_64; rv:71.0) Gecko/20100101 Firefox/71.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: https://s.id' -H 'Connection: keep-alive' -H 'Referer: https://s.id/' --data 'url=https%3A%2F%2Fne.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
l |
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" | |
"net/http" | |
) | |
import ( | |
"github.com/julienschmidt/httprouter" | |
) |
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
defmodule PhoenixCrudWeb.ApiController do | |
use PhoenixCrudWeb, :controller | |
# create | |
def insert(conn, %{"username" => username, "password" => password}) do | |
case Mongo.insert_one(:local_database, "users", %{username: username, password: password}) do | |
{:ok, _} -> | |
conn |> json(%{success: 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
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func index(w http.ResponseWriter, r *http.Request) { | |
w.WriteHeader(200) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Login</title> | |
<style type="text/css" media="screen"> | |
form { | |
margin:0 auto; | |
width:300px |