Skip to content

Instantly share code, notes, and snippets.

@dperezrada
dperezrada / ris.py
Last active May 20, 2022 15:04
Tool for parsing RIS files using python
import io
import sys
import re
import csv
import json
def get_parts(ris_file_text):
ris_text_parts = re.split(r'\nER -( |\n|$)', ris_file_text)
if len(ris_text_parts) == 1:
ris_text_parts = re.split(r'\r?\n\r?\n', ris_file_text)
aasd:
- lala
require "selenium-webdriver"
require "rspec"
include RSpec::Expectations
describe "Prueba" do
before(:each) do
unless ENV["DRIVER"]
ENV["DRIVER"] = 'phantomjs'
end
# Get some path and absolutes paths
PATH_BEFORE_SCRIPT=`pwd`;
SCRIPT_NAME=`basename $0`;
SCRIPT_DIRNAME=`dirname $0`;
cd $SCRIPT_DIRNAME;
SCRIPT_ABSOLUTE_DIRNAME=`pwd`;
# We expect one parameter
if [[ "$#" -ne 1 ]]; then
echo "Usage: script_with_target_dir.sh <target_dir>" >&2;
# Install PasteScript
pip install PasteScript
# Create a new project
paster create myproject
# (You should input the requested information, you can press enter to skip)
# Go to the new project
cd myproject
@dperezrada
dperezrada / instal_python.sh
Created December 31, 2011 18:27
Prepare python on Ubuntu
# Install python
sudo aptitude install python-setuptools
sudo easy_install pip
sudo pip install virtualenv
# Create a new enviroment
mkdir ~/envs
cd ~/envs
virtualenv --no-site-packages my_project