Skip to content

Instantly share code, notes, and snippets.

@chrisliuqq
chrisliuqq / tourney.html
Created July 21, 2013 00:21 — forked from sterlingwes/tourney.html
對戰表
<!DOCTYPE html>
<html>
<head>
<title>Tournament Bracket Generator</title>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script>
$(document).on('ready', function() {
var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes)
@import "compass/utilities/sprites"; // Include compass sprite helpers
@import "compass/css3/background-size"; // Include helper to calc background size
@mixin sprite($name, $hover: false, $active: false) {
@include retina-sprite($name, $sprites, $sprites2x, $hover, $active);
}
// The general purpose retina sprite mixin.
//
# First commit
echo "hello" | git hash-object -w --stdin
git update-index --add --cacheinfo 100644 ce013625030ba8dba906f756967f9e9ca394464a hello.txt
git write-tree
git commit-tree aaa96c -m "First commit"
git update-ref refs/heads/master 30b060d9a7b5e93c158642b2b6f64b2b758da40d
# Second commit
@chrisliuqq
chrisliuqq / gist:6865643
Created October 7, 2013 10:22
css tree digaram
http://codepen.io/chuongdang/pen/lcnsC
<!--
We will create a family tree using just CSS(3)
The markup will be simple nested lists
-->
<div class="tree">
<ul>
<li>
<a href="#">Parent</a>
@chrisliuqq
chrisliuqq / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@extends('admin.layout')
@section('content')
<h1 class="page-header">新增文章</h1>
@if (count($errors->all()) > 0 )
<div class="alert alert-danger" role="alert">
@foreach ($errors->all() as $error)
<p>{{ $error }}</p>
@endforeach
</div>
@endif

Jenkins Port Forwarding (8080 -> 80) with pf on Mavericks/Yosemite

This guide is a fork from this gist. I've added minor adjustments to customise these rules to forward connections from an outsite interface like en0.

Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

1. Create the anchor file

Create an anchor file under /etc/pf.anchors/com.jenkins with your redirection rule like:

@chrisliuqq
chrisliuqq / php.php
Last active June 4, 2019 08:14
How to use laravel Auth::user() outside laravel and pass data in custom php?
The solution above for 5.2 should still work. In 5.5+ you just need to change bootstrap/autoload.php to vendor/autoload.php.
<?php
require '/path/to/laravel/vendor/autoload.php';
$app = require_once '/path/to/laravel/bootstrap/app.php';
$app->make('Illuminate\Contracts\Http\Kernel')
->handle(Illuminate\Http\Request::capture());
@chrisliuqq
chrisliuqq / model.php
Created March 16, 2016 08:33
get laravel table schema in model
<?php
public function getTableColumns()
{
return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());
}
@chrisliuqq
chrisliuqq / poe.filter
Last active April 19, 2016 07:45
POE filter
# 顯示有品質的寶石
Show
Class Gem
Quality > 0
SetBorderColor 128 128 255
# 五連以上
Show
LinkedSockets >= 5
SetBackgroundColor 0 128 0
# 貨幣