Skip to content

Instantly share code, notes, and snippets.

Claudemiro dimiro1

Block or report user

Report or block dimiro1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View stimulus.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
View base.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Page Title</title>
</head>
<body>
<header>This is the header, this is the same on all pages</header>
{% block content %}This content we can override on child templates{% endblock %}
View params.go
package main
import (
"fmt"
"net/http"
"time"
)
type Params interface {
String(r *http.Request, name string) string
View bla.go
package main
import (
"context"
"github.com/garyburd/redigo/redis"
)
//TranslationsPipe interface {
//Pipe(ctx context.Context, source dbTranslations.TranslationSource, dest cacheTranslations.TranslationsManager, ids []uint64, defaultNames map[uint64]string) error
//}
View generic.go
package main
import (
"errors"
"fmt"
)
// Person is a demo struct
type Person struct {
Name string
View science.go
package main
import (
"fmt"
"math/rand"
"net/http"
"github.com/gin-gonic/gin/json"
)
View builder.go
package main
import (
"fmt"
"strings"
)
type Clause interface {
By() string
}
View NormalizeString.go
// NormalizeString remove noise chars
// https://blog.golang.org/normalization
// See http://www.fileformat.info/info/unicode/category/index.htm
// No formato NFC cada caractere é representado por um único simbolo
// ex: "é"" no formato NFC == "\u00e9""
// No formato NFD o mesmo caractere é representado por "e\u0301"
// Após converter para NFD fica fácil remover os caracteres extras, apenas passando de byte a byte
// Ao final é necessária a conversão para o formato normalizado NFKD que trata caracteres semelhantes
// como sendo o mesmo símbolo: ex: 'Ω' ("\u03a9") e 'Ω' (Ohm sign "\u2126") podem ser considerados a mesma coisa
func NormalizeString(s string) (string, error) {
View fbp.go
package main
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/rs/xlog"
View pipeline.go
package main
import (
"fmt"
"context"
)
func reverse(s string) string {
r := []rune(s)
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
You can’t perform that action at this time.