Skip to content

Instantly share code, notes, and snippets.

View wwwy3y3's full-sized avatar
🎯
Focusing

william chang(張仲威) wwwy3y3

🎯
Focusing
View GitHub Profile
@wwwy3y3
wwwy3y3 / dnsmasq OS X.md
Created September 13, 2016 15:28 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@wwwy3y3
wwwy3y3 / permission.json
Last active July 23, 2020 04:45
CannerFlow Deployment JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CreateResource",
"Effect": "Allow",
"Action": [
"rds:CreateDBSubnetGroup",
"rds:CreateDBInstance",
"rds:DescribeDBInstances",
@wwwy3y3
wwwy3y3 / test.sql
Created October 23, 2023 05:55
test
SELECT
CASE
WHEN get_userinfo('username') = 'william' THEN appl_id
WHEN get_userinfo('username') = 'jimmy' THEN CONCAT(SUBSTRING(appl_id, 1, LENGTH(appl_id) - 6), 'XXXXXX')
ELSE appl_id
END AS appl_id
FROM ods_report
WHERE unit_code = (
SELECT
CASE
@wwwy3y3
wwwy3y3 / loader.js
Last active October 23, 2023 09:41
test.html
document.getElementById('fetchData').addEventListener('click', async function () {
const loader = document.getElementById('loader');
loader.style.display = 'block';
// Fetch data and update tables...
// After all fetches and updates
loader.style.display = 'none';
});
@wwwy3y3
wwwy3y3 / test.sql
Created October 25, 2023 09:55
oracle
SELECT
'U+' || TO_CHAR(TO_NUMBER(UNICODE(TO_NCHAR(REGEXP_SUBSTR(my_column, '.', 1, LEVEL)))), 'FMXXXX')
AS unicode_str
FROM my_table
CONNECT BY PRIOR dbms_random.value IS NOT NULL
AND PRIOR my_column = my_column
AND PRIOR sys_guid() IS NOT NULL
AND LEVEL <= LENGTH(my_column);
@wwwy3y3
wwwy3y3 / ingress.yaml
Last active October 26, 2023 13:08
test
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx-public
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
nginx.ingress.kubernetes.io/rewrite-target: /$1
labels:
@wwwy3y3
wwwy3y3 / script.json
Last active August 22, 2024 07:47
script
{
"masterDatabaseUsername": "<secret>",
"masterDatabasePassword": "<secret>",
"keycloakMasterRealmAdminPassword": "<secret>",
"keycloakDbPassword": "<secret>",
"sqlEngineDbPassword": "<secret>",
"webDbPassword": "<secret>",
"metabasePassword": "<secret>",
"minioPassword": "<secret>",
"sqlPropertiesEncryptKey": "<secret>"