Skip to content

Instantly share code, notes, and snippets.

Doan Thanh Nam tndoan

Block or report user

Report or block tndoan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Some_ffmpeg_tips
# convert from webm to mp3
ffmpeg -i input.webm output.mp3
# split mp3 file to several audio files whose length is 3600s and the names of these files begin with out<id>.mp3
ffmpeg -i out.mp3 -f segment -segment_time 3600 -c copy out%03d.mp3
@tndoan
tndoan / Moviepy.py
Last active Apr 9, 2017
MoviePy example
View Moviepy.py
from moviepy.editor import *
import moviepy.video.fx.all as vfx
clip = VideoFileClip('fname.mp4')
mclip = clip.fx(vfx.mirror_x) # all frame in clip will be mirrored in x-axis
mclip.write_videofile('mirror_fname.mp4')
##################################################
clip = VideoFileClip('fname.mp4')
@tndoan
tndoan / 4sq_category_tree.txt
Last active Aug 29, 2015
All category tree of Foursquare. Count the number of space in the begining of string to indicate the level of category.
View 4sq_category_tree.txt
Arts & Entertainment
Aquarium
Arcade
Art Gallery
Bowling Alley
Casino
Circus
Comedy Club
Concert Hall
Country Dance Club
@tndoan
tndoan / sent_example.py
Created Jan 2, 2014
It is the example of using Python to request the result from Sentiment 140. This example is based on http://help.sentiment140.com/api
View sent_example.py
import urllib2
import json
s = '{"data": [{"text": "I love Titanic."},{"text": "I hate Titanic."}]}' # 2 short text that we want to do sentiment analysis
response = urllib2.urlopen('http://www.sentiment140.com/api/bulkClassifyJson', s) # request to server
page = response.read() # get the response
print page # print the result
View memusg
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
set -um
# check input
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; }
You can’t perform that action at this time.