This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
set numSafari to count (every process whose name is "Safari") | |
end tell | |
if numSafari > 0 then | |
tell application "Safari" | |
set URLList to {} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
set numSafari to count (every process whose name is "Safari") | |
end tell | |
if numSafari > 0 then | |
tell application "Safari" | |
set URLList to {} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// don't forget to put the following cell magic, | |
// if used inside a Jupyter notebook | |
// %%javascript | |
IPython.OutputArea.auto_scroll_threshold = 9999; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
import matplotlib.pyplot as plt | |
mpl_params = {'text.usetex': True, | |
'font.family': 'serif', | |
'font.serif': 'Palatino', | |
'text.latex.preamble': [r'\usepackage{engsymbols}', | |
r'\usepackage{magref}', | |
r'\usepackage{siunitx}']} | |
matplotlib.rcParams.update(mpl_params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function closeapp() { | |
osascript -e "quit app \"$1\"" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This script closes the window name passed as argument, e.g. | |
; AutoHotkey.exe closewindow.ahk "Visual Studio Code" | |
; To match strings anywhere in the window title | |
SetTitleMatchMode 2 | |
If (WinExist(A_Args[1])) | |
WinClose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $HOME/latex-writing/paper-magnetic-profiles/ | |
# sync repo | |
git pull origin master | |
# open Visual Studio Code to edit and run scripts | |
code -n . | |
# Sourcetree is a Git client | |
SourceTree.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sincroniza de volta mudanças feitas | |
git push origin | |
# ver explicações abaixo para esses comandos | |
cf PaperMagneticProfiles_JBSMSE.tex | |
closew "paper-magnetic-profiles - Visual Studio Code" | |
closew "Sourcetree" | |
closew "Outline_Paper_Profiles" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# example input parameters | |
phi_S_IV = 50 | |
# how much each segment occupies of the whole magnet region | |
fractions_phi = np.array([20,20,20,20,20]) | |
assert sum(fractions_phi) == 100 |
OlderNewer