Skip to content

Instantly share code, notes, and snippets.

View dongweiming's full-sized avatar
:octocat:
๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”

Weiming Dong dongweiming

:octocat:
๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”๐Ÿค”
View GitHub Profile
@dongweiming
dongweiming / v2ex.py
Last active December 31, 2016 09:25
https://www.v2ex.com/t/313225 ๆŠฝๅฅ–่„šๆœฌ
#coding=utf-8
import re
from collections import defaultdict
from datetime import datetime
import requests
# https://github.com/livid/v2ex/blob/master/api.py#L247
url = 'https://www.v2ex.com/api/replies/show.json'
rs = requests.get(url, params={'topic_id': 313225, 'page': 11})
@squarism
squarism / iterm2.md
Last active April 17, 2025 20:55
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab โŒ˜ + T
Close Tab or Window โŒ˜ + W (same as many mac apps)
Go to Tab โŒ˜ + Number Key (ie: โŒ˜2 is 2nd tab)
Go to Split Pane by Direction โŒ˜ + Option + Arrow Key
Cycle iTerm Windows โŒ˜ + backtick (true of all mac apps and works with desktops/mission control)
@staltz
staltz / introrx.md
Last active April 17, 2025 06:34
The introduction to Reactive Programming you've been missing
@jeffmo
jeffmo / gist:054df782c05639da2adb
Last active January 11, 2024 06:05
ES Class Property Declarations
@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active November 5, 2024 21:41
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@aras-p
aras-p / preprocessor_fun.h
Last active April 7, 2025 13:38
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@vgoklani
vgoklani / app.py
Last active December 19, 2022 09:13
Using Flask to output Python data to High Charts
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}
@nightire
nightire / ่งฃๅ†ณ Git ๅœจ windows ไธ‹ไธญๆ–‡ไนฑ็ ็š„้—ฎ้ข˜.md
Last active January 15, 2025 09:28
่งฃๅ†ณ Git ๅœจ windows ไธ‹ไธญๆ–‡ไนฑ็ ็š„้—ฎ้ข˜

่งฃๅ†ณ Git ๅœจ windows ไธ‹ไธญๆ–‡ไนฑ็ ็š„้—ฎ้ข˜

ๅŽŸๅ› 

ไธญๆ–‡ไนฑ็ ็š„ๆ นๆบๅœจไบŽ windows ๅŸบไบŽไธ€ไบ›ๅŽ†ๅฒๅŽŸๅ› ๆ— ๆณ•ๅ…จ้ขๆ”ฏๆŒ utf-8 ็ผ–็ ๆ ผๅผ๏ผŒๅนถไธ”ไนŸๆ— ๆณ•้€š่ฟ‡ๆœ‰ๆ•ˆๆ‰‹ๆฎตไปคๅ…ถๅ…จ้ขๆ”ฏๆŒใ€‚

่งฃๅ†ณๆ–นๆกˆ

  1. ๅฎ‰่ฃ…
@SlexAxton
SlexAxton / .zshrc
Last active March 24, 2025 17:35
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else