Skip to content

Instantly share code, notes, and snippets.

View bitqiu's full-sized avatar
🏢
Working

Bit Qiu bitqiu

🏢
Working
View GitHub Profile
@bitqiu
bitqiu / ApplicationPolicy.php
Created February 18, 2016 02:33 — forked from dcabanaw/ApplicationPolicy.php
ACL in Laravel: Roles and Permissions fix for booting when scheming is not created...
<?php
namespace App\Policies;
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
class ApplicationPolicy
{
/**
* @var GateContract
*/
@bitqiu
bitqiu / 01_Laravel 5 Simple ACL manager_Readme.md
Created February 18, 2016 02:31 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@bitqiu
bitqiu / .env.example
Created December 23, 2015 11:11 — forked from iolson/.env.example
GitLab CI Laravel 5.1.*
DB_HOST=mysql
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
@bitqiu
bitqiu / gitlab.conf
Created December 21, 2015 03:18
gitlab proxy nginx
upstream gitlab {
server 172.17.42.1:10080 fail_timeout=0;
}
# let gitlab deal with the redirection
server {
listen 80;
server_name git.example.com;
server_tokens off;
root /dev/null;
@bitqiu
bitqiu / demo.md
Last active November 7, 2015 01:47
前端部署

CSS部分

添加上注释,如下:

<!-- build:css css/app.min.css -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="lib/ionic/css/ionic.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- endbuild -->

直接通过注释来合并文件,注释解释: build:合并类型 合并后文件存放路径

@bitqiu
bitqiu / genymotionwithplay.txt
Created October 29, 2015 02:50 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161892865 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
@bitqiu
bitqiu / Http.php
Created September 6, 2015 00:57
Http.php
<?php
/**
* HTTP Client
*
* @example
* <pre>
* Usage:
*
* Http::get($url, $params);
* Http::post($url, $params);
@bitqiu
bitqiu / formatime.php
Created August 28, 2015 02:07
formatime.php
<?php
function formatTime($secs)
{
$timeFormats = array(
array(0, '< 1 sec'),
array(2, '1 sec'),
array(59, 'secs', 1),
array(60, '1 min'),
array(3600, 'mins', 60),
array(5400, '1 hr'),
@bitqiu
bitqiu / sublime-settings
Last active August 29, 2015 14:25
sublime text3 material_theme
{
"always_show_minimap_viewport": true,
// "bold_folder_labels": true,
"font_face": "Monaco",
"font_options":
[
"gray_antialias"
],
"font_size": 14,
"highlight_line": true,