Skip to content

Instantly share code, notes, and snippets.

View juanjosecas's full-sized avatar
🥲
I may be VERY slow to respond.

Juan Casal juanjosecas

🥲
I may be VERY slow to respond.
View GitHub Profile
@juanjosecas
juanjosecas / .bash_profile
Created May 31, 2017 15:39 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
from __future__ import division
from scene import *
from math import sqrt, pi
import sound
button_pad = [['ans', 'pi', 'sqrt(', '%'],
['(', ')', '*', '/'],
['7', '8', '9', '-'],
['4', '5', '6', '+'],
['1', '2', '3', '='],
@juanjosecas
juanjosecas / chaos.py
Created December 6, 2016 20:57 — forked from jameslzhu/chaos.py
Brownian motion simulator, written with VPython.
#!/usr/bin/env python2
#
# chaos - jzhu98
# See bottom for license.
#
from __future__ import division
from enum import Enum
@juanjosecas
juanjosecas / pdb.py
Created December 6, 2016 20:56 — forked from samberg/pdb.py
def read_molecule(reader):
line=reader.readline()
if not line:
return None
while not line.startswith('COMPND'):
line=reader.readline()
key, name = line.split()
molecule=[name]
line = reader.readline()
@juanjosecas
juanjosecas / combineGro_prot_lig.py
Created December 5, 2016 21:31
usage: python combineGro_prot_lig.py protein_processed.gro BNZ.gro > complex.gro
import sys
pro_gro = sys.argv[1]
lig_gro = sys.argv[2]
pro = open(pro_gro,'r').readlines()
lig = open(lig_gro,'r').readlines()
pro_dat = [line.rstrip() for line in pro]
lig_dat = [line.rstrip() for line in lig]
tot_num = int(pro_dat[1])+int(lig_dat[1])
com_dat = [pro_dat[0],'%5d'%tot_num]+pro_dat[2:-1] + lig_dat[2:-1] + [pro_dat[-1]]
for line in com_dat: print line
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1