Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Let's connect! Shoot at achillesrasquinha@gmail.com

Achilles Rasquinha achillesrasquinha

💭
Let's connect! Shoot at achillesrasquinha@gmail.com
View GitHub Profile
View extracellular-matrix.fasta
>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 Jun 12, 2019
Import into Python via String
View import-python-string.md

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 Aug 28, 2018
Make files/directories using a Python dict.
View make_files_directories_using_a_python_dict.md

Make Files/Directories using a Python Dict

Script

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

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 Sep 17, 2021
A Python Popen that does not suck.
View popen.md

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')
View download_mp3_using_youtube_dl.md

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 Sep 4, 2018
A python script to update all your pip packages
View pip-update-all.md
@achillesrasquinha
achillesrasquinha / db_open_helper_post.md
Last active Jun 27, 2020
Database Open Helper Class for Android SQLite Database.
View db_open_helper_post.md

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
View android_square_layout.md

Android Square Layout

java

package <your_package_name>

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