Skip to content

Instantly share code, notes, and snippets.

View TankyH's full-sized avatar

tengqiu.huang TankyH

View GitHub Profile
@xareelee
xareelee / learn_meteor_phase_1.md
Last active June 9, 2023 17:05
如何學習 Meteor.js (第一階段)

如何學習 Meteor.js (第一階段)

Meteor 是一個 full-stack 的開發框架 (或者該說是平台),它可以利用一種語言 (JavaScript) 來輕鬆完成前後端的開發。是目前前景看好的選擇。

本階段的目標是:

  • 了解 Meteor 是什麼樣的平台,基本架構,可以做到什麼樣的事情 (2.5 hr)
  • 能夠自己獨立完成一個 Meteor 的 ToDo App (不斷的練習一樣的 App,直到完全熟悉,+10 hr)

這階段大約花 10-20 hr,可以利用一個週末的兩天時間,或是一個禮拜的晚上來完成。

@vielhuber
vielhuber / script.sh
Last active April 28, 2024 06:38
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@haojian
haojian / secret_garden.py
Created August 12, 2015 22:42
secret garden
import skimage;
from skimage import data
from skimage.filters import threshold_otsu
from skimage.segmentation import clear_border
from skimage.measure import label
from skimage.morphology import closing, square
from skimage.measure import regionprops
from skimage.color import label2rgb
import cv2
import numpy as np
@Nagyman
Nagyman / workflows-in-django.md
Last active January 27, 2024 08:29
Workflows in Django

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
@denji
denji / nginx-tuning.md
Last active May 3, 2024 03:57
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

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.

@ranlix
ranlix / combineTS.py
Last active July 15, 2018 09:45
将同一目录下所有.ts文件合并到一个新的.ts文件(PS: .ts文件是可以直接合并的视频文件,因此可以这样合并)
# -*-coding: utf-8 -*-
import sys
import os
num = sys.argv[1] # num is the amount of *.ts files
def add(x):
"""'x' is the amount of *.ts
This function should add all other .ts combined into '1.ts'