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
// ==UserScript== | |
// @name Disable GitLab issues drawer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Disable GitLab issues drawer | |
// @author Gabriel Ferreira | |
// @match https://gitlab.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=gitlab.com | |
// @grant none | |
// ==/UserScript== |
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 pickle | |
import os | |
import glob | |
import subprocess | |
import lzma | |
# Simulation_path is the CWD for the simulation (where results will be saved) | |
# Base_dir is the path to the directory containing the simulation program | |
# args is a list of arguments for the simulation program | |
def execute_simulation(simulation_path, base_dir, args): |
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
#include <cmath> | |
#include <ns3/core-module.h> | |
#include <ns3/mobility-module.h> | |
#include <ns3/netanim-module.h> | |
using namespace ns3; | |
Vector polarToRectangular(double radius, double theta, double offsetx, double offsety) | |
{ |
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/python3 | |
# | |
# Latex2Markdown | |
# | |
# Copyright (C) 2021 Gabriel Ferreira | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 |
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 requests | |
import json | |
from datetime import datetime | |
import csv | |
import sys | |
#G1 source https://especiais.g1.globo.com/bemestar/coronavirus/mapa-coronavirus/ | |
urlBrazilMap = "https://especiais.g1.globo.com/bemestar/coronavirus/mapa-coronavirus/data/brazil-map.json" | |
urlCases = "https://especiais.g1.globo.com/bemestar/coronavirus/mapa-coronavirus/data/brazil-cases.json" |
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
from selenium import webdriver | |
from scrapy import Spider | |
import time | |
#url = 'https://www.rottentomatoes.com/m/empire_strikes_back/reviews' | |
url = 'https://www.rottentomatoes.com/m/star_wars_the_rise_of_skywalker/reviews' | |
class SkywalkaSpider(Spider): | |
name = 'Skywalka' | |
allowed_domains = [url] |
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
""" | |
Configure gcc with -ftime-report and run "make -j1 1 > compile_targets.txt 2 > time_reports.txt" | |
Yes, -j1 will take a long time, but you really want these results to analyze your compilation time, | |
don't you? | |
""" | |
sample_compile_target = """ | |
[ 12%] Building CXX object src/internet/CMakeFiles/ns3.30.1-internet-reldeb-obj.dir/model/icmpv4.cc.o | |
[ 12%] Building CXX object src/internet/CMakeFiles/ns3.30.1-internet-reldeb-obj.dir/model/icmpv4-l4-protocol.cc.o | |
""" | |
sample_time_report = """ |
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
SOURCE_PATH = "/mnt/dev/tools/source/NS3_relative_path/" | |
import os | |
import re | |
REGEX_MATCH_STRING = "#include*.*[<\"](?!sys|net|linux|netinet|unistd|errno)(.*.h)[>\"]" | |
""" | |
Test cases for regex matching of header files finishing with .h | |
Resulting header file without <> or "" is stored in re.search(REGEX_MATCH_STRING, string_to_match).group(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
# You will need matplotlib to run this script (python -m pip install matplotlib) | |
# | |
# Recursive tangent demonstrated by Mathologer Burkard Polster in "Pi is IRRATIONAL: animation of a gorgeous proof" | |
# https://www.youtube.com/watch?v=Lk_QF_hcM8A | |
# | |
# tan(x) = x | |
# ----------------------------------------- | |
# 1 - x^2 | |
# ------------------------------------- | |
# 3 - x^2 |
NewerOlder