Skip to content

Instantly share code, notes, and snippets.

@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"