Skip to content

Instantly share code, notes, and snippets.

View teddy-ma's full-sized avatar

Ma Lucheng teddy-ma

View GitHub Profile
@teddy-ma
teddy-ma / parser_test.rb
Last active July 19, 2019 00:35
tdd org blog parser
class ArticleGeneratorTest < Minitest::Test
BLOG_TEXT = <<EOF
* single post
:PROPERTIES:
:EXPORT_FILE_NAME: demo-article-1
:END:
** Today is Friday
Friday Line _one_
Friday Line _two_
time ffmpeg -v quiet -y -i 92-.mp4 -vcodec copy -acodec copy -ss 00:00:00 -t 00:10:00 \
-sn test3.mkv -vcodec copy -acodec copy -ss 00:10:00 -t 00:25:47 -sn test4.mkv
@teddy-ma
teddy-ma / unload-keyboard
Created November 9, 2015 22:46 — forked from JohnMurray/unload-keyboard
Disable Mac OS X Keyboard (built-in only)
#!/bin/bash
# Unload the keyboard so I can use my external keyboard
# and not worry about accidentally pressing buttons on
# the built-in. This may not be a problem for you but, you
# should see my desk sometimes (Oh no!!) ;-)
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
@teddy-ma
teddy-ma / SassMeister-input-HTML.html
Created October 25, 2015 15:38
Generated by SassMeister.com.
<div class="row">
<div class="columns small-6">
我占一半
</div>
<div class="columns small-6">
我也占一半
</div>
</div>
@teddy-ma
teddy-ma / SassMeister-input-HTML.html
Created October 25, 2015 15:34
Generated by SassMeister.com.
<div class="main">
<div class="brother">
我占一半
</div>
<div class="brother">
我也占一半
</div>
</div>
@teddy-ma
teddy-ma / gist:4e473ef609116f4441cf
Last active August 29, 2015 14:17
常用 gulp 例子
// task
gulp.task('minify-html', function () {
gulp.src('app/*.html') // path to your files
.pipe(minifyHtml())
.pipe(gulp.dest('dist/html'));
});
gulp.task('rename', function () {
gulp.src('app/scripts/app.coffee') // path to your file
.pipe(coffee()) // compile coffeeScript
@teddy-ma
teddy-ma / gist:6d47c6405a68f118c1ff
Created February 9, 2015 03:13
dyne vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@teddy-ma
teddy-ma / gist:dee8d4cff4c97acfefc5
Created January 22, 2015 09:27
163 ubuntu14.04 source
sudo gedit /etc/apt/sources.list
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
@teddy-ma
teddy-ma / Vagrantfile
Created June 20, 2014 02:56
a chef vagrant file example
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This is a Vagrant configuration file. It can be used to set up and manage
# virtual machines on your local system or in the cloud. See http://downloads.vagrantup.com/
# for downloads and installation instructions, and see http://docs.vagrantup.com/v2/
# for more information and configuring and using Vagrant.
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
--title 用 Ruby 构建碉堡的命令行应用程序
--author 马陆骋(Teddy-Ma@github Teddy@ruby-china)
--date today
--center <Build Awesome Command Line applications in Ruby2> 读书笔记
--center For absolute beginners
--center And some little examples
--newpage main
--heading Command Line Application