Skip to content

Instantly share code, notes, and snippets.

{
"cmd": ["g++","-std=c++11","-Wall","*.cpp", "-I",
"../header","-o", "${file_path}/${file_base_name}",
"&&",
"${file_path}/${file_base_name}"],
"selector": "source.c++",
"shell": true
}
@santiago-salas-v
santiago-salas-v / unzip_all.py
Last active December 25, 2022 23:34 — forked from kalkulus/unzip_all.py
PYTHON: unzip / unrar all files in a directory at same directory where rar file present. Remove original archive.
#!/usr/bin/python
import os, zipfile, pyunpack
basis_folder = r'C:\Users\ssv\Documents\tmp'
for root, dirs, files in os.walk(basis_folder):
for filename in files:
if filename.endswith(".rar") :
print('RAR:'+os.path.join(root,filename))
elif filename.endswith(".zip"):
print('ZIP:'+os.path.join(root,filename))
@santiago-salas-v
santiago-salas-v / mccabe_thiele_wilson_meoh_h2o.ipynb
Created July 28, 2018 17:30
McCabe Thiele Method, Methanol-Water
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@santiago-salas-v
santiago-salas-v / mccabe_thiele_wilson_meoh_h2o.ipynb
Created July 28, 2018 17:30
McCabe Thiele Method, Methanol-Water
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@santiago-salas-v
santiago-salas-v / htlatex.py
Last active February 1, 2020 14:55
sublimetext plugin to convert latex to html and pdf to png
import sublime
import sublime_plugin
import os
import subprocess
import threading
class HtlatexCommand(sublime_plugin.TextCommand):
def run(self, edit, filename=None):
@santiago-salas-v
santiago-salas-v / basic_constants_from_the_properties_of_gases_and_liquids.py
Last active June 23, 2018 20:06
Lennard-jones potential parameters and basic constants from properties of gases and liquids tables as csv
import os
import re
sel_component_numbers = [30, 31, 438, 440, 27, 26, 455, 66, 96, 61]
print('Selected components:')
print(sel_component_numbers)
print('')
test_exp_descriptors = '(^[0-9]{1,3})\|(.*)\|(.*)\|' + \
'([0-9]{1,7}-[0-9]{1,7}-[0-9]{1,7})'
@santiago-salas-v
santiago-salas-v / lvkg.py
Last active June 8, 2018 22:49
Berechnung von Impuls- und Wärmeübertragungseigenschaften einfacher Gase nach kinetischer Gastheorie
import numpy as np
from scipy.interpolate import interp1d
from scipy import interpolate
t = 25 + 273.15 # K
p = 1.01325 # bar
komponente = np.array(['N2','O2','Ar','Luft'])
# Bird Tabelle E.1
tc = np.array([126.2, 154.4, 150.7, 132]) # K
pc = np.array([33.5, 49.7, 48.0, 36.4]) # atm
muc = np.array([180., 250., 264., 193.])*1e-6 # g/cm/s
import numpy as np
komponente=np.array(['CO2','O2','N2'])
mm_i=np.array([44.01,32,28.02])
mu=np.array([1462e-7,2031e-7,1754e-7])
x_a=np.array([0.133,0.039,0.828])
phi_ab = np.zeros([komponente.size, komponente.size])
for alpha in range(phi_ab.shape[0]):
for beta in range(phi_ab.shape[1]):
phi_ab[alpha, beta] = 1/np.sqrt(8)*(
1+mm_i[alpha]/mm_i[beta])**(-1/2.)*(
@santiago-salas-v
santiago-salas-v / fig_001.png
Last active August 7, 2018 19:01
Hagen Fogler Froment Bird
fig_001.png
@santiago-salas-v
santiago-salas-v / put_tracknumber_at_start_of_title.py
Created May 14, 2018 15:01
ID3 tags tracknumber at start of title (for sorting by players)
import os
from mutagen.easyid3 import EasyID3
folder = os.path.abspath(u'.')
folder_exists = os.path.exists(folder)
for file in os.scandir(folder):
file_path = os.path.join(folder, file.name)
print(file_path)
actual_number = file.name.split('_')[0]