Skip to content

Instantly share code, notes, and snippets.

View tucq88's full-sized avatar
🎯
Fake it till you make it. Confidence is more important than knowledge.

Tu Chu tucq88

🎯
Fake it till you make it. Confidence is more important than knowledge.
View GitHub Profile
@tucq88
tucq88 / Gruntfile.js
Last active August 29, 2015 14:12 — forked from anonymous/Gruntfile.js
module.exports = function(grunt) {
// All configuration goes here
grunt.initConfig({
jekyll: {
build : {
dest: '_site'
}
},
<?php
public function routeClass()
{
$routeArray = Str::parseCallback(Route::currentRouteAction(), null);
if (last($routeArray) != null) {
// Remove 'controller' from the controller name.
$controller = str_replace('Controller', '', class_basename(head($routeArray)));
@tucq88
tucq88 / vim74centos
Last active August 29, 2015 14:27 — forked from juxtin/vim74centos
Compile Vim 7.4 on Centos and install my vimrc
#!/bin/bash
yum groupinstall 'Development tools' -y
yum install ncurses ncurses-devel wget git -y
cd /usr/local/src
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
tar -xjf vim-7.4.tar.bz2
cd vim74
./configure --prefix=/usr --with-features=huge --enable-rubyinterp --enable-pythoninterp
make && make install
@tucq88
tucq88 / ISC.md
Created May 17, 2016 03:55 — forked from indexzero/ISC.md
ISC vs. MIT

Copyright (c) 4-digit year, Company or Person's Name

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Source: http://opensource.org/licenses/ISC

@tucq88
tucq88 / Git branch bash autocomplete *with aliases*
Last active February 20, 2017 09:08 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
#TODO Make bash dir and go to
mkdir ~/.bash && cd ~/.bash
#TODO CURL to get the file
curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
@tucq88
tucq88 / gist:1179d101e441824e512ae142b6fbaf6f
Created August 17, 2016 05:52 — forked from prsws/gist:8162386
A Multi-Tenant Strategy using Yii and MySQL

Introduction

This article describes an implementation of multi-tenancy using Yii and MySQL. “Multi-tenancy” is but one (yet crucial) aspect of SaaS applications; refer to the IBM document Convert your web application to a multi-tenant SaaS solution for more information on what else makes a webapp a SaaS application.

Moreover, there are three main architectures for multi-tenant databases: separate database, separate schemas and a single database. Refer to the Microsoft document Multi-Tenant Data Architecture for more information.

As MySQL doesn’t have schemas (at least the same way MS SQL Server and Oracle do) the only choices are a separate database for each tenant and single database with “commingled” tenant data. SaaS applications with a relatively small number of tenants can be easily managed with a database for each one, but for large numbers of tenants its

@tucq88
tucq88 / pr.md
Created November 25, 2016 02:16 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@tucq88
tucq88 / bash-cheatsheet.sh
Created May 24, 2017 11:02 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@tucq88
tucq88 / .csscomb.json
Created October 27, 2017 04:08 — forked from Yimiprod/.csscomb.json
smacss definition for scss-lint and csscomb
{
"exclude": [
".git/**",
"node_modules/**"
],
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": false,