Skip to content

Instantly share code, notes, and snippets.

View thebabush's full-sized avatar
🎹
Hammer time

thebabush thebabush

🎹
Hammer time
View GitHub Profile
#!/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"
#!/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'
@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"
@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
# Copyright: Benjamin Weiss (keyboardsurfer) https://github.com/keyboardsurfer
# Under CC-BY-SA V3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)
# linux text editor backups
*~
# built application files
*.apk
*.ap_
*.jar
@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 / 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 :)

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 / 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"
@thebabush
thebabush / ipython_cython_embed.py
Last active February 22, 2018 02:09
Run IPython.embed() inside Cython
# Cython/pyximport don't work 100% with the `inspect` module.
# For this reason, `IPython.embed()` is not able to get the locals from the current frame.
# This is how to work around that
import IPython
def embed(locs):
# Pass the locals explicitly
IPython.embed(user_ns=locs)