Skip to content

Instantly share code, notes, and snippets.

View erickguan's full-sized avatar

Erick Guan erickguan

View GitHub Profile
@mikoim
mikoim / README.md
Last active May 21, 2024 13:21
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@Lapin0t
Lapin0t / mongodb_match.py
Last active July 9, 2018 10:44
mongoDB-style json querying in python
from functools import reduce
import re
_TYPES = {'string': str, 'int': int, 'object': dict, 'array': list,
'bool': bool, 'null': type(None)}
_OPS = {'$eq': lambda s, d: s == d,
'$gt': lambda s, d: d > s,
'$gte': lambda s, d: d >= s,
@sycx
sycx / alipay_acclog.py
Created February 28, 2016 19:14
Import Alipay ACCLOG file to beancount
#!/usr/bin/env python3
import sys
import csv
import argparse
import datetime
def _amount_match(a1,a2):
d1 = float(a1) if a1 else 0
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@quake
quake / gist:7972812
Created December 15, 2013 13:06
ActiveRecord输出上周被点击最多的文章标题
Blog.where(created_at: 1.week.ago.beginning_of_week..1.week.ago.end_of_week).order(view_counts: :desc).first.subject
@jamesarosen
jamesarosen / git_extraction.md
Created October 24, 2012 16:13
Extracting a directory from a git project

Recently, I needed to extract a number of directories from a git project each into their own projects. The original directory structure looked like

project/
  subprojects/
    Foo/
    Bar/
    Baz
@jnrbsn
jnrbsn / GPL.md
Last active April 29, 2023 14:59
A Markdown-formatted GPL for your GitHub projects.

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.