Skip to content

Instantly share code, notes, and snippets.

@tvst
tvst / SessionState.py
Last active April 14, 2024 20:24
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
@dangom
dangom / bart_centos_installer.bash
Last active November 22, 2020 02:57
Install Berkeley Advanced Reconstruction Toolbox without admin rights on a CentOS machine.
#!/bin/bash
# Time-stamp: <2017-07-19 15:06:39 dangom>
# Script for installing BART and dependencies from source on a CentOS machine without admin rights.
# Steps:
# 1. Build OpenBLAS from source to enable support for LAPACKE C API.
# 2. Build FFTW3 from source to enable float32 support (fftw defaults to double precision. BART doesn't)
# 3. Link against Matlab2016, because something changed in Matlab2017 and the BART build breaks.
# 4. Download Cmake >= 3 since cluster ships with old cmake 2.8
@joselitosn
joselitosn / pysmb.py
Created March 16, 2016 13:45
Python SMB Example
from smb.SMBConnection import SMBConnection
userID = 'user'
password = 'password'
client_machine_name = 'localpcname'
server_name = 'servername'
server_ip = '0.0.0.0'
domain_name = 'domainname'
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@cypriss
cypriss / README.md
Last active June 18, 2018 11:57
Rails 2.3.14 Ruby 1.9.3 - Monkey Patches

How we upgraded UserVoice, a Rails 2.3.14 app, to Ruby 1.9.3.

Blog post here

@rduplain
rduplain / README.md
Created October 17, 2011 20:04
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini: