Skip to content

Instantly share code, notes, and snippets.

@chrisliuqq
chrisliuqq / Seti.sublime-color-scheme
Last active February 4, 2022 09:14
Migrated Seti color scheme from tmTheme
// Documentation at https://www.sublimetext.com/docs/color_schemes.html
{
"name": "Seti 2022 Color Scheme",
"variables":
{
"blue": "#276aff",
"light_blue": "#55b5db",
"red": "#cd3f45",
"green": "#9fca56",
"light_green": "#5eebb8",
@chrisliuqq
chrisliuqq / sh.sh
Created November 9, 2020 16:25
mac 10.12 make php 7.4.12
# because brew's installation is alwasys failed maybe due to the os 10.12 too old.
# so i have to configure and build myself, and remove some configure parameters to bypass some mismatch extension
./buildconf --force
./configure --prefix=/usr/local/Cellar/php/7.4.12 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/7.4 --with-config-file-path=/usr/local/etc/php/7.4 --with-config-file-scan-dir=/usr/local/etc/php/7.4/conf.d --with-pear=/usr/local/Cellar/php/7.4.12/share/php/pear --with-os-sdkpath= --enable-bcmath --enable-calendar --enable-dtrace --enable-ftp --enable-gd --enable-mbregex --enable-mbstring --enable-mysqlnd --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-bz2=/usr --with-curl --with-external-gd --with-external-pcre --with-gettext=/usr/local/opt/gettext --with-gmp=/usr/local/opt/gmp --with-iconv=/usr --with-layout=GNU --with-libxml --with-libedit --with-mhash=/usr --with-mysql-sock=/tmp/mysql.sock --with-mysqli=my
@chrisliuqq
chrisliuqq / code.md
Last active October 30, 2020 17:55
nginx backend service proxy

original question

如果想要在 nginx server static file,先 proxy pass 到某一服務幫忙轉 webp 並且 serve webp 的服務,在 port 5555,因為害怕那個服務死掉,所以死掉時,要保留原本自動 alias 到原本的 image file
原本
    location /media/ {
        alias /home/scott/project-name/media/;
 } 
@chrisliuqq
chrisliuqq / global_fix.scss
Last active February 24, 2020 06:02
fix for header, footer
* {
font-family: "PingFang TC", "Microsoft JhengHei", "微軟正黑體",
"Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
}
.header {
font-size: 16px;
.container {
@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()
@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 / 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 / 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

新闻

推荐列表

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

method: GET

content-type: text/html

@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==