Skip to content

Instantly share code, notes, and snippets.

View lambdalisue's full-sized avatar
🎮

Λlisue (Ali sue・ありすえ) lambdalisue

🎮
View GitHub Profile
@lambdalisue
lambdalisue / colors.py
Created March 13, 2014 16:01
A library of Colors
#!/usr/bin/env python
# coding=utf-8
"""
Colors
"""
__author__ = 'Alisue <lambdalisue@hashnote.net>'
import collections
Colors = collections.namedtuple('Colors', [
"LIGHT_PINK", "LIGHT_BROWN", "LIGHT_PURPLE", "LIGHT_ORANGE",
"LIGHT_BLUE", "LIGHT_GREEN", "LIGHT_RED", "LIGHT_BLACK",
@lambdalisue
lambdalisue / aminoacids.py
Created April 27, 2014 13:25
A library for handling Amino Acid sequence
# coding=utf-8
"""
Amino acid sequence manupulation library
"""
__author__ = 'Alisue <lambdalisue@hashnote.net>'
AMINOACIDS = list("ARNDCEQGHILKMFPSTWYV")
AMINOACIDS3 = (
'ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLU', 'GLN', 'GLY', 'HIS', 'ILE', 'LEU',
'LYS', 'MET', 'PHE', 'PRO', 'SER', 'THR', 'TRP', 'TYR', 'VAL',
)
@lambdalisue
lambdalisue / extend_cd_spectrum.py
Created May 15, 2014 01:52
A script to extend MRME column to raw CD spectrum
# coding=utf-8
"""
"""
__author__ = 'Alisue <lambdalisue@hashnote.net>'
import numpy as np
import maidenhair
def calc_mean_residue_weight(weight, n):
"""
Caclulate Mean Residue Weight (MRW) by:
@lambdalisue
lambdalisue / manage.py
Created May 27, 2014 12:48
Django 1.2-1.6 compatible manage.py
# coding=utf-8
"""
Django 1.2 - 1.6 compatible manage.py
Modify this script to make your own manage.py
"""
__author__ = 'Alisue <lambdalisue@hashnote.net>'
import os
import sys
@lambdalisue
lambdalisue / runtests.py
Created June 6, 2014 07:58
A general django app test running script
#!/usr/bin/env python
#==============================================================================
# A generic django app test running script.
#
# Author: Alisue <lambdaliuse@hashnote.net>
# License: MIT license
#==============================================================================
import os
import sys
import optparse # argparse is prefered but it require python 2.7 or higher
@lambdalisue
lambdalisue / utils.vim
Created June 29, 2014 17:03
vimscript: call_on_buffer
function! gista#utils#call_on_buffer(expr, funcref, ...) abort " {{{
let cbufnr = bufnr('%')
let save_lazyredraw = &lazyredraw
let &lazyredraw = 1
if type(a:expr) == 0
let tbufnr = a:expr
else
let tbufnr = bufnr(a:expr)
endif
if tbufnr == -1
@mm0205
mm0205 / gist-file0.md
Last active August 29, 2015 14:11
vim-gistaの挙動がおかしくなる件

vim-gistaの挙動がおかしくなる件

現象

  1. vim-gistaをインストール後、初回ログイン時にe-mailアドレスで
    GitHubにログインする

  2. vim上で:w!しても保存できない。

  3. :Gistaすると別のファイルとしてGistに保存される

@reu
reu / ssh-copy-id
Created February 3, 2011 13:45
ssh-copy-id
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
@lambdalisue
lambdalisue / gist:1145772
Last active September 26, 2015 19:17
Get absolute execution directory path in Sh
#!/bin/sh
# --- long way
ROOT=`dirname $0`
ROOT=`cd $ROOT;pwd`
# --- short way
ROOT=$(cd $(dirname $0);pwd)
# --- with readlink
SELF=$(readlink -f $0)
@lambdalisue
lambdalisue / patch.sh
Created September 20, 2011 17:44
Mac OS X PIL install patch
#!/bin/bash
if [ `which brew` = '' ]; then
echo "You have to install Homebrew first"
exit 1
fi
echo "Installing required packages for PIL..."
brew install libjpeg
brew install https://raw.github.com/yuuna/homebrew/freetype/Library/Formula/freetype2.rb