Skip to content

Instantly share code, notes, and snippets.

@radaniba
radaniba / django_deploy.md
Created April 26, 2021 03:22 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@radaniba
radaniba / test.json
Last active December 15, 2020 14:48
test
{"name": "AS", "children": [{"name": "BSP_UM-SAL_AS_12", "children": [{"name": "FLOW-B_AS_12", "children": [{"name": "FLOW-B_AS_12_2", "size": 200}, {"name": "FLOW-B_AS_12_1", "size": 200}, {"name": "FLOW-B_AS_12_3", "size": 200}, {"name": "FLOW-B_AS_12_4", "size": 200}]}, {"name": "RNA-B_AS_12", "size": 200}]}, {"name": "BSP_PAX-B_AS_34", "size": 200}]}
@radaniba
radaniba / format_time.R
Last active April 18, 2016 01:25
Format Date field from excel into a timeseries into csv
# If not installed please install the gdata package by using this command
#install.packages("gdata")
require(gdata)
#df = read.xls("demo.txt", sheet = 1, header = TRUE, method="tab")
df = read.csv("demo.txt", header = TRUE, sep="\t")
numberOfDays <- function(date) {
@radaniba
radaniba / express_pipeline.ipynb
Last active September 9, 2015 22:39
Running pipelines everywhere on any server
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@radaniba
radaniba / Rython Code Battles
Created July 27, 2015 19:37
Rython : Learn Data Science while fighting
Rython : Learn Data Science using 2 programming languages, while having fun
Data Wrangling in Python and R
- Data Structures
- Reading / Writing from/to files
- Extracting data from the web
- Transforming Data
Data Visualization
- Scatterplots
- Histograms
" set runtimepath+=~/.vim_runtime
" source ~/.vim_runtime/vimrcs/basic.vim
" source ~/.vim_runtime/vimrcs/filetypes.vim
" source ~/.vim_runtime/vimrcs/plugins_config.vim
" source ~/.vim_runtime/vimrcs/extended.vim
" try
" source ~/.vim_runtime/my_configs.vim
" catch
@radaniba
radaniba / my_vimrc
Last active October 12, 2016 18:09
" set runtimepath+=~/.vim_runtime
" source ~/.vim_runtime/vimrcs/basic.vim
" source ~/.vim_runtime/vimrcs/filetypes.vim
" source ~/.vim_runtime/vimrcs/plugins_config.vim
" source ~/.vim_runtime/vimrcs/extended.vim
" try
" source ~/.vim_runtime/my_configs.vim
" catch
@radaniba
radaniba / report_generator.py
Created July 9, 2015 23:17
This small code goes over a lot of bismark results and create a summary tables based on features you want to extract
"""
This is a small python script to generate a report based on multiple analysis from bismark
It creates a single doncument (report) as a table
Rows are data parsed
Columns will be samples analyzed
The script takes as argument :
- a path where we have several bismark individual results
- an output filename
@radaniba
radaniba / create_graph.py
Last active August 29, 2015 14:24
using networkx to create a simple graph
import networkx as nx
import matplotlib.pyplot as plt
def draw_graph(graph, labels=None, graph_layout='shell',
node_size=1600, node_color='blue', node_alpha=0.3,
node_text_size=12,
edge_color='blue', edge_alpha=0.3, edge_tickness=1,
edge_text_pos=0.3,
text_font='sans-serif'):
@radaniba
radaniba / test_order.py
Created May 21, 2015 23:35
Read a custom order that the user provides and output a list that will be given to some functions The file should contain one sample name per line
def read_custom_order(order_file):
"""
Read a custom order that the user provides and output a list that will
be given to some functions
The file should contain one sample name per line
"""
samples_order = []
with open(order_file, 'r') as f:
for line in f:
samples_order.append(line.split(" ")[0])