Skip to content

Instantly share code, notes, and snippets.

@vulcangz
vulcangz / gist.go
Created July 15, 2019 09:35 — forked from alexedwards/gist.go
SCS v2 Manual Load and Save
package main
import (
"io"
"net/http"
"github.com/alexedwards/scs/v2"
)
var session = scs.NewSession()
@vulcangz
vulcangz / gist.go
Created July 15, 2019 09:00 — forked from alexedwards/gist.go
SCS v2 Multiple Sessions
package main
import (
"database/sql"
"fmt"
"log"
"net/http"
"time"
"github.com/alexedwards/scs/v2"
@vulcangz
vulcangz / main.go
Created March 19, 2019 11:33 — forked from KeKsBoTer/main.go
Dice graph
package main
import (
"flag"
"fmt"
"math/big"
"strconv"
"github.com/ALTree/bigfloat"
)
@vulcangz
vulcangz / ManyManySupport.php
Created October 7, 2017 08:34 — forked from tanakahisateru/ManyManySupport.php
MANY_MANY relation support behavior for Yii framework
<?php
/**
* This behavior is for a model having one or more MANY-MANY relations.
*
* You need a junction table:
*
* CREATE_TABLE self_target (
* self_id integer(11) NOT NULL,
* target_id integer(11) NOT NULL,
* ...
@vulcangz
vulcangz / ResponsiveLinkPager.php
Created October 7, 2017 08:29 — forked from tanakahisateru/ResponsiveLinkPager.php
Bootstrap responsive pagination widget for Yii
<?php
namespace app\utils\widgets;
use yii\helpers\Html;
use yii\widgets\LinkPager;
/**
* ResponsiveLinkPager can reduce or style each buttons for responsive design.
*
* Define CSS classes as if maxButtonCount would be so. For example below applies hidden-xs class
@vulcangz
vulcangz / install_golang.sh
Created August 6, 2017 11:11 — forked from jniltinho/install_golang.sh
Install Golang on Linux
#!/bin/bash
## Install Golang 1.8 64Bits on Linux (Debian|Ubuntu|OpenSUSE|CentOS)
## http://www.linuxpro.com.br/2015/06/golang-aula-1-instalacao-da-linguagem-no-linux.html
## Run as root (sudo su)
## Thank's @geosoft1 | @gwmoura
GO_URL="https://storage.googleapis.com/golang"
GO_VERSION=${1:-"1.8.1"}
GO_FILE="go$GO_VERSION.linux-amd64.tar.gz"