Skip to content

Instantly share code, notes, and snippets.

View gokusenz's full-sized avatar
🎯
Focusing

Nattawut Ruangvivattanaroj gokusenz

🎯
Focusing
View GitHub Profile
@gokusenz
gokusenz / EncryptAESWithPHP
Created April 20, 2016 11:23 — forked from krzyzanowskim/EncryptAESWithPHP
How to encrypt data with padding usign AES cipher, complatible with CryptoSwift defaults.
// Marcin Krzyżanwski
// Code for https://github.com/krzyzanowskim/CryptoSwift/issues/20
// PHP
function encrypt($plaintext, $key, $iv) {
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_CBC, $iv);
return base64_encode($ciphertext);
}
function decrypt($ciphertext_base64, $key, $iv) {
@gokusenz
gokusenz / Dockerfile
Last active March 29, 2017 10:29
Dockerfile
FROM node:7.7.4
FROM node:7
FROM node:7.7
FROM node:7.7.4
FROM node:7.7.4-alpine
@gokusenz
gokusenz / GoMgoSample-1.go
Created June 1, 2017 06:30 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@gokusenz
gokusenz / sonarqube-scanner
Last active June 28, 2017 06:26
sonarqube-scanner (gulpfile.js)
const gulp = require('gulp');
const sonarqubeScanner = require('sonarqube-scanner');
gulp.task('default', (callback) => {
sonarqubeScanner({
serverUrl: 'http://localhost:9000',
token: '',
options: {
},
}, callback);
@gokusenz
gokusenz / docker-compose.yml
Created June 28, 2017 06:27
SonarQube - docker-compose.yml
version: '2'
services:
sonar:
image: sonarqube:5.6.6-alpine
ports:
- "9000:9000"
depends_on:
- sonardb
package main
import (
"fmt"
"github.com/bradfitz/gomemcache/memcache"
)
func main() {