Skip to content

Instantly share code, notes, and snippets.

View thebabush's full-sized avatar
🎹
Hammer time

thebabush thebabush

🎹
Hammer time
View GitHub Profile
@thebabush
thebabush / wav2mp3.bat
Created September 27, 2017 12:50
Convert all WAVs in a directory to MP3s (VBR 150/195 kbps) using ffmpeg on windows
REM Put this file in a directory and double click on it
REM Some details:
REM - ffmpeg must be in the system PATH
REM - you can change the bitrate easily by changing the "q" parameter (https://trac.ffmpeg.org/wiki/Encode/MP3)
for /f "tokens=1 delims=." %%a in ('dir /B *.wav') do ffmpeg -i "%%a.wav" -q:a 3 "%%a.mp3"

Keybase proof

I hereby claim:

  • I am kenoph on github.
  • I am kenoph (https://keybase.io/kenoph) on keybase.
  • I have a public key ASDM2sDBmy36iF2z4zWL2-xOVW6zgdOcPbQ8VFIq3qdjmAo

To claim this, I am signing this object:

@thebabush
thebabush / kaggle_resubmit.js
Created May 7, 2016 13:22
Kaggle Private Leaderboard Re-evaluation
/**
* Replace CSV download links with urls to re-evaluate the past submission.
* Basically, you can get the private leaderboard score without re-uploading the file.
*
* USAGE:
* 1) Copy this script and change COMPETITION_URL accordingly
* 2) Go to "My Submissions" page
* 3) Open the Developer Console
* 4) Paste the script and execute it
* 5) Click on the links to open new tabs :)
@thebabush
thebabush / simple_autoencoder.py
Last active April 16, 2016 12:14
Keras: get hidden layer's output (autoencoder)
#!/usr/bin/env python
import keras
import keras.callbacks
import keras.models
import keras.optimizers
import keras.layers
import numpy as np
import theano
@thebabush
thebabush / crx.py
Created January 23, 2016 15:42
Get ZIP file from Chrome CRX extension format
# Because I was on Windows, without dd :)
import os
import struct
import sys
if len(sys.argv) != 3:
print "Usage:", sys.argv[0], "<crx file> <zip file>"
exit(0)
@thebabush
thebabush / xp.js
Last active March 15, 2021 21:42
Javascript XPath Helper
/**
* Helper to make Javascript's XPath calls simpler.
* Basically you just need to give a query to the xp function.
* Especially useful in manual testing of XPath strings inside a browser's console.
*
* Example:
* xp("//body/text()")
*
* Author: Paolo Montesel
* License: https://opensource.org/licenses/MIT
@thebabush
thebabush / mount-nexus4.sh
Created January 29, 2015 11:23
Insultingly stupid script to mount nexus4 on Kubuntu. Just to remember that go-mtpfs is the only program that works decently.
#!/bin/sh
sudo umount ~/nexus4/
sudo go-mtpfs -allow-other=true ~/nexus4
@thebabush
thebabush / .xprofile
Last active August 29, 2015 14:10
Kubuntu Japanese Input
# sudo apt-get install scim
# sudo apt-get install scim-anthy
# sudo apt-get install scim-gtk-immodule
# sudo apt-get install scim-qt-immodule
#
# CHROME:
# GTK_IM_MODULE=xim XMODIFIERS="@im=SCIM" chromium-browser %U
export XMODIFIERS="@im=SCIM"
#export GTK_IM_MODULE="scim"
#!/usr/bin/python
"""
Find IMDB id of a given movie searching by title.
Works with all languages, not just English like
all the IMDB-python libs I've found on the internet.
"""
__author__ = '3mpty'
#!/bin/sh
## Remove Unity package files from project directory.
## On windows with GIT installed, use GIT bash.
##
## Author: Paolo Montesel
if [ $# -ne 2 ]
then
echo "Usage: ./script.sh unity.package projectDirectory"