Skip to content

Instantly share code, notes, and snippets.

@harmy
harmy / 12factor.md
Created August 23, 2012 14:30
12factor

中文翻译:梁山 英文原文:Adam Wiggins

简介

如今,软件通常会作为一种服务来交付,它们被称为网络应用程序,或“软件即服务”(SaaS)。“十二要素应用程序”(12-Factor App)为构建如下的SaaS应用提供了方法论:

  • 使用标准化流程自动配置,从而使新的开发者花费最少的学习成本加入这个项目;
  • 和操作系统之间尽可能的划清界限,在各个系统中提供最大的可移植性
  • 适合部署在现代的云计算平台,从而在服务器和系统管理方面节省资源;
@shijinkui
shijinkui / gist:5132586
Created March 11, 2013 07:41
几个特殊的shell变量
特殊的shell变量:
$0 获取当前执行的shell脚本的文件名
$n 获取当前执行的shell脚本的第n个参数值,n=1..9
$* 获取当前shell的所有参数 “$1 $2 $3 …注意与$#的区别
$# 获取当前shell命令行中参数的总个数
@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@arunoda
arunoda / gist:7790979
Last active February 16, 2024 14:05
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@danackerson
danackerson / 100_base.conf
Last active October 20, 2023 10:11
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {
@zhang2333
zhang2333 / [译]Visual Studio Code文档其1—基本使用.md
Last active March 8, 2017 14:23
[译]Visual Studio Code文档其1—基本使用

#Visual Studio Code的基本使用 全文翻译自[官方Docs][1]

Visual Studio Code的核心是一个代码编辑器。像许多其他代码编辑器一样,VS Code采用了普遍的UI设计,将显示所有可访问的文件及文件夹的目录树置于左侧,并将文件内容编辑器置于右侧。下面本篇将描述VS Code的几个独特之处。

译者注:NodeJS方面VS Code是Sublime很好的替代品,不妨试试

##文件与Project VS Code以文件、文件夹为基础——你可以通过VS Code打开文件夹来立即启动project。

VS Code可以读写不同框架或平台中不同类型的文件。即便你的VS Code同时打开了package.jsonproject.jsontsconfig.json甚至ASP.NET 5 Visual Studio的项目文件,VS Code仍然可以读取它们并为你提供相应的附加功能,如[IntelliSense][2]。

#!/bin/bash
# download MS COCO dataset
#
# ref: http://mscoco.org/dataset/#download
echo "Downloading..."
wget http://msvocds.blob.core.windows.net/annotations-1-0-3/instances_train-val2014.zip && \
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active April 11, 2024 22:29
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
@snowwalf
snowwalf / video.api.md
Last active April 16, 2019 14:38
视频鉴黄/鉴暴恐/暴恐检测API