Skip to content

Instantly share code, notes, and snippets.

View plutov's full-sized avatar
🎥
https://www.youtube.com/packagemain

Alex Pliutau plutov

🎥
https://www.youtube.com/packagemain
View GitHub Profile
@plutov
plutov / email_regexp
Created August 31, 2013 14:13
Email regexp pattern
/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\@[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\.[a-zA-Z]{2,4}$/
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/500", func(res http.ResponseWriter, req *http.Request) {

Keybase proof

I hereby claim:

  • I am plutov on github.
  • I am pliutau (https://keybase.io/pliutau) on keybase.
  • I have a public key ASCQ2BQRF0sie5Go5wpnhRV617iLqHEU4uDF1bA3OKMX4Ao

To claim this, I am signing this object:

def application do
[applications: [:logger, :maru], mod: {Elixirrest, []}]
end
defp deps do
[{:maru, "~> 0.2.8"}]
end
use Mix.Config
config :maru, Elixirrest.Api,
http: [port: 3030]
defmodule Elixirrest.Api do
use Maru.Router
alias Elixirrest.Agent, as: Store
namespace :items do
desc "get all items"
get do
Store.get |> json
end
defmodule Elixirrest do
use Maru.Router
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
worker(Elixirrest.Agent, [])
]
@plutov
plutov / reset.js
Last active January 8, 2018 02:48
reset.js
function alterForgotPasswordScreen() {
var $dialog = $('.gigya-screen-dialog, .gigya-screen-dialog-mobile'),
$form = $dialog.find('form[name="gigya-forgot-password-form"]'),
$email = $form.find('input[name="username"]');
$email.focus(function() {
showUpdatePasswordError('');
});
$form.submit(function (e) {
@plutov
plutov / tensorflow1.go
Created January 8, 2018 10:31
tensorflow1.go
func main() {
os.Setenv("TF_CPP_MIN_LOG_LEVEL", "2")
if len(os.Args) < 2 {
log.Fatalf("usage: imgrecognition <image_url>")
}
fmt.Printf("url: %s\n", os.Args[1])
// Get image from URL
response, e := http.Get(os.Args[1])
@plutov
plutov / tensorflow2
Created January 8, 2018 10:32
tensorflow2
docker build -t imgrecognition .
docker run imgrecognition https://www.iaspaper.net/wp-content/uploads/2017/10/Rabbit-Essay.jpg