Skip to content

Instantly share code, notes, and snippets.

View ming-chu's full-sized avatar
:octocat:
Focusing

Kenneth Chu ming-chu

:octocat:
Focusing
View GitHub Profile
@ming-chu
ming-chu / duplicates.py
Last active May 23, 2024 05:34 — forked from tfeldmann/duplicates.py
Fast duplicate file finder written in python (only show file size > 1MB)
#!/usr/bin/env python
"""
Fast duplicate file finder.
Usage: duplicates.py <folder> [<folder>...]
Based on https://stackoverflow.com/a/36113168/300783
Modified for Python3 with some small code improvements.
"""
import os
import sys
@ming-chu
ming-chu / index.ts
Created November 16, 2023 03:35 — forked from jsdevtom/index.ts
Connect to MongoDB from Google Cloud function best practice through Maintaining Persistent Connections
import {CustomError} from "./error/custom-error.interface";
require('dotenv').config();
import {RequestHandler} from 'express';
import {MongoClient} from 'mongodb';
let client: MongoClient;
const connectToClientIfDropped: () => Promise<void> = async () => {
if (client && client.isConnected()) {
@ming-chu
ming-chu / CountryCodes.json
Last active March 16, 2023 11:59 — forked from anubhavshrimal/CountryCodes.json
Country and Dial or Phone codes in JSON format
[{
"name": "Afghanistan",
"dial_code": "+93",
"emoji": "🇦🇫",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"emoji": "🇦🇽",
@ming-chu
ming-chu / combine.py
Created January 17, 2021 03:33 — forked from glombard/combine.py
Merging 4 images into one with Python and PIL/Pillow
# Combine multiple images into one.
#
# To install the Pillow module on Mac OS X:
#
# $ xcode-select --install
# $ brew install libtiff libjpeg webp little-cms2
# $ pip install Pillow
#
from __future__ import print_function
@ming-chu
ming-chu / README-Template.md
Created March 31, 2020 17:27 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ming-chu
ming-chu / django_cheat_sheet.md
Created February 22, 2019 15:04 — forked from bradtraversy/django_cheat_sheet.md
Django command cheat sheet

Django 2.x Cheat Sheet

Creating a virtual environment

We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder

python -m venv ./venv
@ming-chu
ming-chu / AssetRecorderView.swift
Created November 22, 2018 03:28 — forked from levantAJ/AssetRecorderView.swift
Record video, with auto detect faces, and overlay mask into faces
//
// AssetRecorderView.swift
// Snowball
//
// Created by Le Tai on 7/20/16.
// Copyright © 2016 Snowball. All rights reserved.
//
import UIKit
import AVFoundation
@ming-chu
ming-chu / FilterCam.swift
Created September 14, 2018 13:12 — forked from bgayman/FilterCam.swift
Setup AVCaptureSession with CIFilter
//
// ViewController.swift
// CameraFilter
//
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
#import <AVFoundation/AVFoundation.h>
#import "Recorder.h"
@interface Recorder()<AVCaptureAudioDataOutputSampleBufferDelegate>{
AVCaptureDevice *audioDevice;
AVCaptureDeviceInput *audioInput;
AVCaptureAudioDataOutput* _audioDataOutput;
dispatch_queue_t _captureQueue;
AVURLAsset *_asset;