Skip to content

Instantly share code, notes, and snippets.

View goodjack's full-sized avatar
:octocat:
嗨~

小克 goodjack

:octocat:
嗨~
View GitHub Profile
@ti-ka
ti-ka / Retrive Json Data from Mysql.sql
Created March 10, 2017 16:34
If you have saved data into a field as json, you can use mysql to retrieve each field. It may be useful in migrating database when you have decided that using JSON in a database was not a good idea.
/* APPENDIX 1-B: CLEANUP
This makes this sql query re-run able */
DROP TABLE IF EXISTS JSON_TABLE;
DROP TABLE IF EXISTS SPLIT_TABLE;
DROP VIEW IF EXISTS SPLIT_VIEW;
/* APPENDIX 1-B: Prepare TABLE
Let's say this is an example table */
@Birdie0
Birdie0 / ifttt-webhooks-extended-guide.md
Last active April 8, 2025 06:34
How to use Discord Webhooks

⚠️ This gist is no longer updated! For maintained, improved and even more extended guide click here.


How to use Discord Webhook

It's a JSON

First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.

@mpneuried
mpneuried / Makefile
Last active April 29, 2025 08:09
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@nasirkhan
nasirkhan / laravel-controller-method-commands.php
Last active March 10, 2025 14:22
Call Laravel Controller methods via command line
<?php
php artisan tinker
$controller = app()->make('App\Http\Controllers\MyController');
app()->call([$controller, 'myMethodName'], []);
//the last [] in the app()->call() can hold arguments such as [user_id] => 10 etc'
@billy3321
billy3321 / Markdown Cheatsheet 中文版.md
Last active May 7, 2025 10:09
Markdown Cheatsheet 中文版
anonymous
anonymous / AidConverter.java
Last active November 7, 2018 14:03
import com.google.common.base.Splitter;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.ihad.ptt.model.bean.AidBean;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
/**
* 文章編號與檔案名稱轉換工具<br />
@yang-wei
yang-wei / phpbrew-config.md
Created October 28, 2015 04:44
How to use switch PHP(using phpbrew) version in nginx config
php -v
PHP 5.6.3 (cli) (built: Oct 28 2015 09:47:41)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies

But this only changes in CLI. You have to tweak you nginx(same for apache) to make it works. Nginx will still using the native PHP-FPM.

> ps aux | grep php-fpm
@fntsrlike
fntsrlike / git-team-work-flow.md
Last active October 14, 2022 06:23
Git 團隊工作流程風格:每當要做新專案時,都會貼這個給合作夥伴。

Team Work Flow

Git

Setting

請依照您的作業系統針對版本控制換行字元同步做設定。

Windows

@tiegz
tiegz / uniqlo.rb
Last active July 25, 2021 19:10
uniqlo scraper
require 'json'
require 'pp'
class UniqloProductFetcher
attr_accessor :json
# eg 135779 is pocketable shorts
def initialize(product_id: "135779")
@product_id = product_id
end
@kwmiebach
kwmiebach / pytest.md
Last active May 13, 2025 10:02 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help: