A collection of peer-to-peer decentralized projects. Contact me to add your project!
More project can be found here: https://www.gnunet.org/links/
| import ( | |
| "database/sql" | |
| "database/sql/driver" | |
| "errors" | |
| "fmt" | |
| "github.com/lib/pq" | |
| _ "github.com/lib/pq" | |
| "math/rand" | |
| "net/url" | |
| "strings" |
| Pry.config.editor = "vim --noplugin" | |
| if defined?(PryByebug) | |
| Pry.commands.alias_command 'c', 'continue' | |
| Pry.commands.alias_command 's', 'step' | |
| Pry.commands.alias_command 'n', 'next' | |
| Pry.commands.alias_command 'f', 'finish' | |
| Pry.commands.alias_command 'b', 'break' | |
| Pry.commands.alias_command 'bda', 'break --disable-all' | |
| end |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| res = | |
| with {:ok} <- validate_request(request), | |
| {:ok, user} <- get_user(request), | |
| {:ok} <- update_db(user), | |
| {:ok} <- send_email(user) do | |
| return_http_message | |
| end | |
| case res do | |
| {:error, x} -> IO.inspect("Error: " <> x) |
A collection of peer-to-peer decentralized projects. Contact me to add your project!
More project can be found here: https://www.gnunet.org/links/
| // Example of how to use stdlib in go, leveraging the simplicity of solutions without dependencies | |
| // based on https://www.youtube.com/watch?v=yi5A3cK1LNA&feature=youtu.be&t=11m45s | |
| func productHandler(w http.ResponseWriter, r *http.Request) { | |
| key := r.URL.PATH[len("/products/"):] | |
| switch r.Method { | |
| case "GET": | |
| // do get stuff | |
| case "POST": | |
| // do post stuff |
| go build -gcflags '-N' |
| package controllers | |
| import env.Env | |
| import play.api.libs.json.JsArray | |
| import play.api.mvc._ | |
| import play.api.libs.concurrent.Execution.Implicits._ | |
| // here's where the injection takes place | |
| class Application(env: Env) extends Controller { | |
| import env._ // to avoid writing something like env.WS.url() or env.configuration.get... |
| (require 'cask "~/.cask/cask.el") | |
| (cask-initialize) | |
| (require 'pallet) | |
| (pallet-mode t) | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; APPEARANCE CUSTOMIZATIONS ;;; | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;; Startup |
| (source "melpa" "http://melpa.milkbox.net/packages/") | |
| (source gnu) | |
| (source marmalade) | |
| (depends-on "auctex") | |
| (depends-on "auto-complete") | |
| (depends-on "cask") | |
| (depends-on "clojure-mode") | |
| (depends-on "coffee-mode") | |
| (depends-on "color-theme") |