Skip to content

Instantly share code, notes, and snippets.

@chrisliuqq
chrisliuqq / git usage.md
Last active December 9, 2016 03:59
git 操作的備忘

取得 git 上昨天開始與現在的所有修改

git diff $(git rev-list -n1 --before="1 day ago" master)

從所有 commit 中刪除特定檔案

remove a file from a git repository with:

git filter-branch --tree-filter 'rm file'

Keybase proof

I hereby claim:

  • I am chrisliuqq on github.
  • I am chrisliu (https://keybase.io/chrisliu) on keybase.
  • I have a public key whose fingerprint is 04EE 2D4E 4783 7EBE 43D0 505B 0FE7 60A3 8A16 CDD8

To claim this, I am signing this object:

/usr/local/share/jre1.8.0_121/bin/java -server \
-d64 \
-Xmx14G \
-XX:NewRatio=3 -XX:+UseThreadPriorities \
-XX:SoftRefLRUPolicyMSPerMB=2048 \
-XX:CMSInitiatingOccupancyFraction=90 \
-XX:MaxGCPauseMillis=50 \
-XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled \
-XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking \
-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 \
@chrisliuqq
chrisliuqq / gist:96de1ef8160a1d41b6af315c6fb611f3
Last active October 4, 2017 11:15
[PHP] Laravel: override the dd helper function

bootstrap/app.php

+require_once __DIR__.'/../app/helpers.php';
require_once __DIR__.'/../vendor/autoload.php';

app/helpers.php

<?php
@chrisliuqq
chrisliuqq / userscript
Created March 23, 2018 15:18
tieba get content
// ==UserScript==
// @name 取得貼罷的內容
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://tieba.baidu.com/p/*?see_lz=1*
// @grant none
// ==/UserScript==

新闻

推荐列表

URL:http://v2.api.dmzj.com/article/recommend/header.json

method: GET

content-type: text/html

@chrisliuqq
chrisliuqq / api.md
Created July 9, 2018 17:21
facebook create page graph api

For some situation, test user could not create page through web, but using graph api explorer may do it.

https://developers.facebook.com/tools/explorer?method=POST&path=me%2Faccounts&version=v3.0&name=Bob%20Test%20Page%201&category=756092301147942&about=Bob%20test&picture=https%3A%2F%2Fbowwowinsurance.com.au%2Fwp-content%2Fuploads%2F2014%2F12%2Ffrench-bulldog-frenchie-700x700.jpg&cover_photo=%7B%22url%22%3A%22https%3A%2F%2Fbowwowinsurance.com.au%2Fwp-content%2Fuploads%2F2014%2F12%2Ffrench-bulldog-frenchie-700x700.jpg%22%7D
@chrisliuqq
chrisliuqq / txt-merge.php
Created February 2, 2019 14:22
txt merge for novels
#!/usr/local/bin/php
<?php
try {
if (!isset($argv[1])) {
throw new Exception("Missing target path", 1);
}
@chrisliuqq
chrisliuqq / install-redis.sh
Created July 5, 2019 03:18 — forked from jpickwell/install-redis.sh
Installing Redis 5.0.0 on Amazon Linux
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=5.0.0
@chrisliuqq
chrisliuqq / AppServiceProvider.php
Created October 29, 2019 16:38 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()