Skip to content

Instantly share code, notes, and snippets.

View goodjob1114's full-sized avatar

Randy Chen goodjob1114

View GitHub Profile
@goodjob1114
goodjob1114 / postgres-cheatsheet.md
Created July 23, 2024 03:57 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@goodjob1114
goodjob1114 / CategoryTree.vue
Created August 20, 2021 17:29 — forked from plong0/CategoryTree.vue
Demo of using single-select Radio Group with Vuetify Treeview
<template>
<v-card>
<v-card-text>
{{ category }}
<radio-tree :items="categories" value-key="id" v-model="category" ref="radioTree"></radio-tree>
</v-card-text>
<v-card-actions>
<v-btn @click.stop="nuke()" color="warning">Nuke</v-btn>
</v-card-actions>
</v-card>
@goodjob1114
goodjob1114 / codility_solutions.txt
Created February 3, 2021 14:19 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
Lesson 1 - Iterations
- BinaryGap - https://codility.com/demo/results/trainingU2FQPQ-7Y4/
Lesson 2 - Arrays
- OddOccurrencesInArray - https://codility.com/demo/results/trainingFN5RVT-XQ4/
- CyclicRotation - https://codility.com/demo/results/trainingSH2W5R-RP5/
Lesson 3 - Time Complexity
- FrogJmp - https://codility.com/demo/results/training6KKWUD-BXJ/
- PermMissingElem - https://codility.com/demo/results/training58W4YJ-VHA/
@goodjob1114
goodjob1114 / ipc.py
Created January 20, 2021 03:55 — forked from decatur/ipc.py
Fast inter-process communication (ipc) for python on MS-Windows using shared memory and eventing.
# -*- coding: utf-8 -*-
"""
Copyright 2018-09-09, Wolfgang Kühn
Fast inter-process communication (ipc) for Python (CPython, PyPy, 2.7, 3.6+) on MS-Windows.
It uses shared memory and eventing.
Example rpc style synchronization:
Server (rpc provider):
@goodjob1114
goodjob1114 / App.js
Created December 14, 2020 09:01 — forked from skolhustick/App.js
ChakraUI - Login Form with ColorMode
import React from 'react'
import {
ThemeProvider,
theme,
ColorModeProvider,
CSSReset,
Box,
Flex,
IconButton,
useColorMode,
@goodjob1114
goodjob1114 / example.py
Created June 29, 2019 18:48 — forked from eddieantonio/example.py
Zero-dependency Python 3 and Node IPC using UNIX sockets
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import socket
import json
server_address = '/tmp/example.sock'
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect(server_address)
@goodjob1114
goodjob1114 / nginx-tuning.md
Created June 3, 2019 02:59 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@goodjob1114
goodjob1114 / Gemfile
Created May 30, 2019 09:58 — forked from rmosolgo/Gemfile
GraphQL Ruby Subscriptions
source 'https://rubygems.org'
gem "graphql", github: "rmosolgo/graphql-ruby", branch: "subscriptions"
gem "sinatra"
gem "thin"
@goodjob1114
goodjob1114 / influxdb.conf
Last active January 25, 2019 07:37 — forked from acherunilam/influxdb.conf
Nginx config for InfluxDB HA
worker_processes 5;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
}
http {
client_max_body_size 20M;
@goodjob1114
goodjob1114 / Makefile.config
Last active March 26, 2018 09:47
make config for caffe with conda and python3.6 env
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers