Skip to content

Instantly share code, notes, and snippets.

View Akagi201's full-sized avatar
🎯
Focusing

Bob Liu Akagi201

🎯
Focusing
View GitHub Profile
# Timecode burn with ffmpeg
# ffmpeg must be configured with --enable-libfreetype
# box=1 - tells ffmpeg to draw a box around the text
# boxcolor - format is 0xRRGGBB[AA]
ffmpeg -i video.mov -vcodec libx264 -cmp 22 -vf "drawtext=fontfile=DroidSansMono.ttf: timecode='09\:57\:00\:00': r=23.976: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099" -y output.mov
CC=gcc
CCFLAGS=-Wall
LDFLAGS=
SOURCES=$(wildcard *.c)
OBJECTS=$(SOURCES:.c=.o)
TARGET=des
all: $(TARGET)
$(TARGET): $(OBJECTS)
# Brian Smith's Super Duper Makefile
# Change CC/CFLAGS/LDFLAGS to fit your needs
# Directory format it searchs for:
# src/ - have your .c/.cc/.cpp files in there
# include/ - have your .h/.hpp files in there
# build/ - empty folder for object files and the executable
# CHANGE THESE TO FIT YOUR NEEDS
CC = cc
CFLAGS = -c -Wall -Iinclude/
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import logging
import datetime
import requests
import BeautifulSoup
from requests.adapters import HTTPAdapter

python3

mkvirtualenv --python=`which python3` nameOfEnvironment

Install Python

$ brew install readline sqlite gdbm
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 1. 需要安装requests(pip3 install -U requests)
# 2. 需要crontab配合以辅助完成自动签到
# 3. 如果想使用自己的当前登录的Cookies
# 请在v2ex的浏览器控制台中输入
# $.getScript('//cdn.rawgit.com/js-cookie/js-cookie/master/src/js.cookie.js', function() { console.log(JSON.stringify(Cookies.get())); })
# 替换V2EXGetReward.cookies文件中的相应的Cookies
#

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@Akagi201
Akagi201 / preprocessor_fun.h
Last active August 29, 2015 14:28 — forked from aras-p/preprocessor_fun.h
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,
@Akagi201
Akagi201 / installing_pyaudio.md
Last active September 22, 2015 07:58 — forked from jiaaro/installing_pyaudio.md
How to install PyAudio into a VirtualEnv on Mac OS X 10.10

Install portaudio using homebrew (or method of your choice)

brew install portaudio

create $HOME/.pydistutils.cfg using the include and lib directories of your portaudio install:

[build_ext]
@Akagi201
Akagi201 / BrewBindInstallAndSetupMacOSX10_10.sh
Created October 23, 2015 02:40 — forked from mpaskalev/BrewBindInstallAndSetupMacOSX10_10.sh
Install and setup bind (named) on Mac OS X 10.10.1 with brew 0.9.5
#!/bin/bash
# Run as root or sudo the commands that need it as you go.
# brew version 0.9.5
# Mac OS X 10.10.1
# A little bit changed version of this:
# http://stackoverflow.com/questions/19538118/osx-mavericks-bind-no-longer-installed-how-to-get-local-dns-server-working