Skip to content

Instantly share code, notes, and snippets.

@ingramchen
ingramchen / gist:e2af352bf8b40bb88890fba4f47eccd0
Created April 5, 2016 12:58
ffmpeg convert gif to mp4, for best cross browser compatibility
### Full command line options
```
ffmpeg -f gif -i FOO.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' BAR.mp4
```
### Notie
* output mp4 is encoded with h264, support Firefox/Chrome/Safari in Windows, Mac OSX, Android, and iOS.
@zotherstupidguy
zotherstupidguy / ARCHANONIRC.md
Created September 30, 2015 09:20
A Quick Guide for Anonymous and Pseudonymous irc

##Weechat+Arch Linux+Tor ###A Quick Guide for Anonymous and Pseudonymous irc I'm going to assume you know what irc is, and generally how it works. If you haven't gotten that far watch a youtube video and try out some of the commands on an irc webclient somewhere. On Arch Linux to install Weechat you can run sudo pacman -S weechat or you can download it from the official website at http://weechat.net/download/.

You can also install Tor from the official repositories, but If you are going to be making multiple connections to irc networks and you want to keep your identities seperate, I would recommend installing the Tor Browser Bundle as well. This should be done from the Tor website, and you should check the GnuPG signature on the package before running it. The key they have been using to sign the packages with for the months that I have been verifying it i

#include <utility>
#ifndef SCOPE_EXIT_H_
#define SCOPE_EXIT_H_
// modeled slightly after Andrescu’s talk and article(s)
namespace std {
namespace experimental {
template <typename EF> struct scope_exit {
// construction

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
#include <stdio.h>
#define TOKENPASTE(x, y) x ## y
#define TOKENPASTE2(x, y) TOKENPASTE(x, y)
#define UNIQUE_FUNC_NAME TOKENPASTE2(cleanuper_func_, __LINE__)
#define UNIQUE_VAR_NAME TOKENPASTE2(cleanuper_var_, __LINE__)
#define SCOPE_EXIT(code_) \
void UNIQUE_FUNC_NAME(int *t __attribute__((unused))) \
code_ \
@lopesivan
lopesivan / install_YouCompleteMe_oblitum.md
Last active August 29, 2015 14:16
Instalando YouCompleteMe do oblitum

Fork de YouCompleteMe

YouCompleteMe by oblitum é um fork da versão original com aprimoramentos para programadores C++ e C no Vim.

Sobre Youcompleteme

YouCompleteMe é uma engine para auxiliar o programador a digitar o código no Vim.

Essa versão oficial do plugin YouCompleteMe

Plataforma testada

@valorin
valorin / mosh-allow-ufw.sh
Created December 6, 2014 20:49
Script to open and close Mosh ports in UFW
#!/bin/bash
# Load active ports
PORTS=`lsof -i | grep mosh-serv | cut -f2 -d":"`
STATUS=`sudo ufw status`
# Add Rules for new ports
for PORT in $PORTS; do
echo $STATUS | grep "$PORT/udp" > /dev/null
@P7h
P7h / tmux__CentOS__build_from_source.sh
Last active May 2, 2024 01:27
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.7
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@drewsberry
drewsberry / dollars-to-html.py
Created September 18, 2014 15:16
Replace equations $ ... $ or $$ ... $$ with KaTeX HTML using Python
import re
import execjs
def find_equations(string):
""" Take in a string, and convert everything between $ ... $ into an inline
equation and everything between $$ ... $$ into a centred equation. """
doubledollar = re.compile(ur"\$\$([^$]+)\$\$")
singledollar = re.compile(ur"(?<![\$])\$([^$]+)\$(?!\$)")
namespace api
{
namespace blah
{
// Opaque handle to the type this namespace exposes functions for
struct Blah;
// Lifetime management (malloc/free with construct/destruct)
Blah* New(u32 param);