Skip to content

Instantly share code, notes, and snippets.

View xbeta's full-sized avatar
🏠
Working from home

Sam Xiao xbeta

🏠
Working from home
  • Monte Carlo Data
  • San Francisco, CA
  • 09:31 (UTC -07:00)
  • LinkedIn in/samxsxiao
View GitHub Profile
@xbeta
xbeta / GIF-Screencast-OSX.md
Created March 31, 2017 05:43 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@xbeta
xbeta / encoding-video.md
Created March 31, 2017 05:43 — forked from Vestride/encoding-video.md
Encoding Video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aacc --with-opus
@xbeta
xbeta / osx-for-hackers.sh
Created June 8, 2016 05:40 — forked from JohnnySlagle/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@xbeta
xbeta / Dockerfile
Created May 13, 2016 04:45 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@xbeta
xbeta / getBlockLists.sh
Created April 14, 2016 08:18 — forked from johntyree/getBlockLists.sh
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@xbeta
xbeta / actionlist.vim
Created March 23, 2016 00:14 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@xbeta
xbeta / README.md
Created October 7, 2015 03:29 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and cli-links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
@xbeta
xbeta / generic.go
Created March 7, 2015 07:49
Golang's "generic"
package main
import "fmt"
type Integer16 int16
type Integer32 int32
type Calculator interface {
Calculate()
}
package main
import (
"time"
"math/rand"
"fmt"
)
func randInt(min int, max int) int {
return min + rand.Intn(max-min)
}
@xbeta
xbeta / 00-set-authorization.groovy
Created November 25, 2014 23:38
put them in $JENKINS_HOME/init.groovy.d/
import jenkins.model.*;
import hudson.security.*;
// JVM did not like 'hypen' in the class name, it will crap out saying it is
// illegal class name.
class BuildPermission {
static buildNewAccessList(userOrGroup, permissions) {
def newPermissionsMap = [:]
permissions.each {
newPermissionsMap.put(Permission.fromId(it), userOrGroup)