Skip to content

Instantly share code, notes, and snippets.

View achillesrasquinha's full-sized avatar
💭
Let's connect! Shoot at achillesrasquinha@gmail.com

Achilles Rasquinha achillesrasquinha

💭
Let's connect! Shoot at achillesrasquinha@gmail.com
  • Madison, Wisconsin
  • 23:53 (UTC -06:00)
View GitHub Profile
>NC_000001.11:150508109-150513789 Homo sapiens chromosome 1, GRCh38.p13 Primary Assembly
AACCGTAACAGCCACCAGACAAGCTTCAGTGGCCGGCCCTTCACATCCAGACTTGCCTGAGAGGACCCAC
CTCTGAGTGTCCAGTGGTCAGTTGCCCCAGGATGGGGACCACAGCCAGAGCAGCCTTGGTCTTGACCTAT
TTGGCTGTTGCTTCTGCTGCCTCTGAGGGAGGTGAGTTGGGGGATCAGCACTTAGGAGGGGGTCTGGGCT
TGCATGGCAGGGGTCTGGGTCCAGGCATCCCAGACGGCTCATCACTAGCAGAGTGATTCTCCGTTTGGCT
TTCCTTTTCTGAGCAGGCCCAAAGTGGGCCTAGGCCAGTGGAGCCTTTAACCAAGGAGGCAGAGAGCAGG
GGCACAGAAGGAGAGGGGTTCCTAGAAACTGCTGCCAAGAAACACAGAATCCCAGTCAAATAGACAACTG
AGTGGGGGGTGGGTTCACAGAGTGAGGGTCTCCTGCTGATGAGGATGTAGGGAGGTGGCTGGTGGGAGAG
GCAAGGGAGGGAAAAGGGGCCCCCAGGCTGCTCAAAACCGGATTGCTGGCCCAGCAAGCCTCGACTGACT
CCCTGTCTGATTAGAGGAGTTGAGGGGTGTCCATCCACAGACCCACCCTCCATCCAGCACAAACACATTC
@achillesrasquinha
achillesrasquinha / import-python-string.md
Created June 12, 2019 21:51
Import into Python via String

Handles

  • import foobar
  • import foo.bar as baz
  • from foo import bar
  • from foo.bar import Baz
  • from foo.bar import BAZ
class HandlerRegistry(dict):
@achillesrasquinha
achillesrasquinha / make_files_directories_using_a_python_dict.md
Last active August 28, 2018 03:51
Make files/directories using a Python dict.

Make Files/Directories using a Python Dict

Script

# imports - standard imports
import os
import os.path as osp
import errno
import collections

Usage

_import('matplotlib') # Installs matplotlib and imports into global space if not available.

Snippet

import os
import os.path as osp
import importlib
@achillesrasquinha
achillesrasquinha / popen.md
Last active April 23, 2024 06:17
A Python Popen that does not suck.

A Python Popen that does not suck.

Function

import os
import subprocess

def popen(*args, **kwargs):
    output      = kwargs.get('output', False)
    directory   = kwargs.get('dir')
@achillesrasquinha
achillesrasquinha / download_mp3_using_youtube_dl.md
Created August 20, 2017 18:02
Download MP3s using youtube-dl

Add this to your .bash_profile file.

alias mp3-dl='function _(){ youtube-dl --extract-audio --audio-format mp3 --output "~/Music/%(title)s.%(ext)s" $1; };_'

On the terminal, type:

$ mp3-dl [YOUTUBE-URL]
@achillesrasquinha
achillesrasquinha / pip-update-all.md
Last active September 4, 2018 09:32
A python script to update all your pip packages
@achillesrasquinha
achillesrasquinha / db_open_helper_post.md
Last active June 27, 2020 15:48
Database Open Helper Class for Android SQLite Database.

Database Open Helper Class for Android SQLite Database

DatabaseOpenHelper.java

// Copyright 2015 Achilles Rasquinha

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@achillesrasquinha
achillesrasquinha / android_square_layout.md
Last active December 8, 2015 06:10
Android Square Layout

Android Square Layout

java

package <your_package_name>

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;