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 random | |
# Set the following arguments | |
noSimulations = 100000 | |
# The following graph is saved in the dictionary "graph" | |
# | |
# A--B--C--D | |
# | | | | | |
# E--F--G--H |
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 re, sys, os | |
if __name__ == '__main__': | |
filePath = os.path.abspath(sys.argv[1]) | |
print("Reading %s"%str(filePath)) | |
with open(filePath, 'r', errors='ignore') as f: | |
data = f.read() | |
print(data) | |
with open(filePath, 'w') as f: |
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
label WHILE_EXP0 | |
push local 0 | |
push local 1 | |
lt | |
push constant 1 | |
add | |
not | |
if-goto WHILE_END0 |
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
let counter = 0; | |
let bound = 10; | |
while (counter < bound + 1) { | |
let counter = counter + 1); | |
} | |
do Output.printInt(counter); |
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
# begin by executing: "scrapy shell {link to flat}" | |
# scrapy exposes a response object that is used in the | |
# in the following few lines of code. Run the lines | |
# individually or simply execute the script by running | |
# "exec(open('imagedownloader.py').read())" in the | |
# scrapy shell. | |
import urllib.request | |
divs = response.css('div') |
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 "open" to open file explorer | |
alias open="nautilus ." | |
# Update system (use with care) | |
alias update="sudo apt-get update && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y" | |
# Always use always with sudo | |
alias apt="sudo apt" | |
# Reverse search bash history (better than CTRL+R imo) - outputs all results to STDOUT |
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
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by | |
" the call to :runtime you can find below. If you wish to change any of those | |
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim | |
" will be overwritten everytime an upgrade of the vim packages is performed. | |
" It is recommended to make changes after sourcing debian.vim since it alters | |
" the value of the 'compatible' option. | |
" This line should not be removed as it ensures that various options are | |
" properly set to work with the Vim-related packages available in Debian. | |
runtime! debian.vim |
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
# C-b is not acceptable -- Vim uses it | |
set-option -g prefix C-a | |
bind-key C-a last-window | |
# Start numbering at 1 | |
set -g base-index 1 | |
# Allows for faster key repetition | |
set -s escape-time 0 |
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
{ | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"editor.formatOnSave": true, | |
"window.zoomLevel": 0, | |
"workbench.startupEditor": "newUntitledFile", | |
"eslint.validate": [ | |
"vue", |
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
#!/usr/bin/env bash | |
# Check that jq and swaymsg are installed | |
if ! command -v jq &> /dev/null || ! command -v swaymsg &> /dev/null; then | |
echo "jq and swaymsg are required for this script to work!" | |
exit 1 | |
fi | |
# Get the app_id of the currently focused window | |
APP=$(swaymsg -t get_tree | jq -r '.. | select(.focused == true)? | .app_id') |
OlderNewer