Skip to content

Instantly share code, notes, and snippets.

Artur Sapek artursapek

Block or report user

Report or block artursapek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View battery.rb
# for tmux status bar
info = `pmset -g batt`.split("\n")
perc = info[1].split(" ")[1].gsub(";","")
charging = info[0].include? "AC Power"
as_f = perc.to_f
if as_f > 75
status = "green"
bars = 4
elsif as_f > 50
status = "yellow"
View mutex.js
// Originally taken from
class Mutex {
constructor() {
this._locking = Promise.resolve();
this._locked = false;
isLocked() {
return this._locked;

Keybase proof

I hereby claim:

  • I am artursapek on github.
  • I am artur ( on keybase.
  • I have a public key whose fingerprint is 1948 D3DF 273B 51B3 A2B3 3745 2E63 8758 C05F 376F

To claim this, I am signing this object:

git log --pretty="format:%an ~ %s" | grep "shit\|fuck\|asshole\|damn" | cut -d "~" -f 1 | sort | uniq -c | sort -n -r
artursapek /
Created Jun 8, 2015
Installing phantomjs 2.0 on Ubuntu 14.04
# Installing Phantomjs 2.0 can be kind of a pain. Their website claims they don't have
# any Linux binaries to share because of an unresolved dependency issue.
# However, someone going by eugene1g shared some binaries that he build that seem
# to work given a small amount of apt-get setup.
sudo su
apt-get update
apt-get install unzip libfontconfig libjpeg-turbo8
cd /tmp
View mov2gif
# mov2giv in out width
# mov2gif gif_file_out.gif 300
tmp_dir=/tmp/frames_$(date +%s)
mkdir $tmp_dir
if [ -z "$3" ]
function gbr {
echo `git name-rev --name-only HEAD`
# when on master:
# > gbr
# master
function dp {
bundle exec cap -s revision=`gbr` $1 deploy
artursapek /
Last active Aug 29, 2015
Convert .mov files to GIFs easily
brew install ffmpeg
brew install imagemagick
brew install libtool --universal
brew link libtool
View daemon.go
func (daemon *Daemon) Run() {
defer func() {
if r:= recover(); r != nil {
fmt.Printf("RECOVER daemon=%s\n", daemon.Slug)
statsd.Increment(fmt.Sprintf("daemon.recover.%s", daemon.Slug))
// Schedule next run
time.Sleep(daemon.UpdateFrequency) // (2 seconds)
go daemon.Run()
View btce-api.go
package btce
import (
You can’t perform that action at this time.