Skip to content

Instantly share code, notes, and snippets.

View artursapek's full-sized avatar
🫃
ate too much

Artur Sapek artursapek

🫃
ate too much
View GitHub Profile
@artursapek
artursapek / remove_css_classes.py
Created November 9, 2013 19:42
Super primitive. Expects one class per line. Did the job
from subprocess import Popen, PIPE
import sys
import re
import os
APP_DIR = '/Users/artur/Work/Codecademy-dev/Codecademy/app/'
VIEWS = ['erb', 'mustache', 'haml']
def search(query, filetypes=[]):
args = ['grep', '-r', '-I', '--exclude=".git"']
package btce
import (
"bytes"
"net/http"
"net/url"
"time"
"crypto/sha512"
"crypto/hmac"
"strconv"
func (daemon *Daemon) Run() {
defer func() {
if r:= recover(); r != nil {
fmt.Printf("RECOVER daemon=%s\n", daemon.Slug)
fmt.Println(r)
statsd.Increment(fmt.Sprintf("daemon.recover.%s", daemon.Slug))
}
// Schedule next run
time.Sleep(daemon.UpdateFrequency) // (2 seconds)
go daemon.Run()
@artursapek
artursapek / deps.sh
Last active August 29, 2015 14:00
Convert .mov files to GIFs easily
brew install ffmpeg
brew install imagemagick
brew install libtool --universal
brew link libtool
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
artursapek / mov2gif
Last active August 29, 2015 14:17
mov2gif
#!/bin/bash
# mov2giv in out width
# mov2gif video_file_in.mov gif_file_out.gif 300
tmp_dir=/tmp/frames_$(date +%s)
mkdir $tmp_dir
if [ -z "$3" ]
then
size=600
@artursapek
artursapek / install-phantomjs.sh
Created June 8, 2015 15:50
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. https://github.com/eugene1g/phantomjs
sudo su
apt-get update
apt-get install unzip libfontconfig libjpeg-turbo8
cd /tmp
git log --pretty="format:%an ~ %s" | grep "shit\|fuck\|asshole\|damn" | cut -d "~" -f 1 | sort | uniq -c | sort -n -r
@artursapek
artursapek / keybase.md
Last active August 29, 2015 14:25
keybase.md

Keybase proof

I hereby claim:

  • I am artursapek on github.
  • I am artur (https://keybase.io/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:

// Originally taken from https://github.com/mgtitimoli/await-mutex
class Mutex {
constructor() {
this._locking = Promise.resolve();
this._locked = false;
}
isLocked() {
return this._locked;