This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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, | |
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"math/big" | |
"strconv" | |
"github.com/ALTree/bigfloat" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
"github.com/alexedwards/scs/v2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"net/http" | |
"github.com/alexedwards/scs/v2" | |
) | |
var session = scs.NewSession() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sessionManager = scs.NewCookieManager("...") | |
func RequireLogin(next http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
session := sessionManager.Load(r) | |
userID, err := session.GetInt("userID") | |
if err != nil { | |
http.Error(w, err.Error(), http.StatusInternalServerError) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<style type="text/css"> | |
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";} | |
#mapBox { | |
width: 90%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Detect operating system in Makefile. | |
# Author: He Tao | |
# Date: 2015-05-30 | |
OSFLAG := | |
ifeq ($(OS),Windows_NT) | |
OSFLAG += -D WIN32 | |
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) | |
OSFLAG += -D AMD64 | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["es2015"], | |
"plugins": ["transform-runtime"] | |
} |
OlderNewer