Skip to content

Instantly share code, notes, and snippets.

/**
* AuthController
*
* @description :: Server-side logic for managing auths
* @help :: See http://links.sailsjs.org/docs/controllers
*/
module.exports = {
index: function (req, res) {
var email = req.param('email');
@vunb
vunb / unity-tweak-tool.sh
Last active October 9, 2016 18:59
Ubuntu 14.04 top taskbar missing, only desktop
#try this for Ubuntu 14.04
sudo apt-get install unity-tweak-tool
#To reset Unity, do
unity-tweak-tool --reset-unity
#Ref: http://askubuntu.com/a/511604
# If ERROR: Cannot autolaunch D-Bus without X11 see the link: http://askubuntu.com/a/748046
@vunb
vunb / centos.sh
Created September 20, 2016 09:12
CentOS / Fedora 'build-essential' equivalent
yum groupinstall "Development Tools"
@vunb
vunb / HealthRecordsController.js
Last active September 6, 2016 03:01
Demo sails (hồ sơ y tế)
var _ = require('lodash')
, async = require("async")
, logger = sails.log
;
module.exports = {
_config: {
actions: true,
shortcuts: false,
rest: false
@vunb
vunb / ubuntu-setup.js
Created August 4, 2016 04:11
Hướng dẫn / thủ tục cài đặt Tensorflow
# Personal Requirements
# Python 2.7
# Ubuntu/Linux 64-bit
# Ubuntu/Linux 64-bit, CPU only, Python 2.7
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp27-none-linux_x86_64.whl
# Python 2
$ sudo pip install --upgrade $TF_BINARY_URL
@vunb
vunb / labelCurrency.js
Created July 18, 2016 05:59
Đổi những số quá dài thành K (trăm ngàn), M (triệu), B(tỷ)
var convert = function(num){
var arrV = [1E9,1E6,1E3],
arrS = ['B','M','K'],
result = num;
arrV.forEach(function(item,index){
if (num < item) return;
var value = Math.ceil(num/item);
if (value<1000 && value >=1) {
result = arrS[index];
};
@vunb
vunb / file0.txt
Created June 15, 2016 15:14 — forked from giwa/file0.txt
Install g++/gcc 4.8.2 in CentOS 6.6 ref: http://qiita.com/giwa/items/28c754d8fc2936c0f6d2
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
@vunb
vunb / assets.js
Last active May 12, 2016 08:29 — forked from fernandolguevara/bootstrap.js
Sails.js seed method
//app/config/assets.js
module.exports = {
seed: true
};
@vunb
vunb / api models Locations.js
Created May 12, 2016 07:09 — forked from juanpasolano/api models Locations.js
seed database on sails js
/**
* Locations.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
seedData:[
@vunb
vunb / ssl.rules
Created January 22, 2016 03:54 — forked from konklone/ssl.rules
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email [email protected].
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {