Skip to content

Instantly share code, notes, and snippets.

View Jitsusama's full-sized avatar
🗯️

Joel Gerber Jitsusama

🗯️
View GitHub Profile
@jjvillavicencio
jjvillavicencio / setup.sh
Last active May 5, 2024 12:53
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 3, 2024 12:26
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@prakhar1989
prakhar1989 / logger.py
Created December 8, 2013 14:43
Sending emails with files as attachments in python 2.4
#!/usr/bin/python
import MySQLdb as mdb
import sys
import csv
import smtplib
from datetime import datetime
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email import Encoders
@vkotovv
vkotovv / app.py
Created August 20, 2013 14:08
Clear data for all tables via flask-sqlalchemy
def clear_data(session):
meta = db.metadata
for table in reversed(meta.sorted_tables):
print 'Clear table %s' % table
session.execute(table.delete())
session.commit()
@daragh
daragh / module_mocking.py
Created September 10, 2012 15:45
Example code for mocking a module in Python
'''
Example code to show how it is possible to mock an entire module by patching
the sys.modules dict using mock ( http://www.voidspace.org.uk/python/mock/ ).
'''
from mock import patch, MagicMock
def test_import_patching():
module_mock = MagicMock()
with patch.dict('sys.modules', **{