Skip to content

Instantly share code, notes, and snippets.

View daguiam's full-sized avatar

Diogo Aguiam daguiam

View GitHub Profile
@loic-nazaries
loic-nazaries / create_a_virtual_environment_with_python.md
Last active August 18, 2024 19:21
Markdown file to help create a virtual environment with Python.

Create a Virtual Environment with Python

The present gist is a hybrid between a 'go-to' cheat sheet and a tutorial when starting a new Data Science Project.

Its purpose is to create a virtual environment with Python using the 'venv' module.

 


@Gridflare
Gridflare / rollpad.py
Last active October 26, 2023 16:11
Numpy roll with padding
import numpy as np
def rollpad(array, rollx, rolly, mode='edge'):
"""Analogous to numpy.roll but using np.pad
for greater flexibility"""
if rollx > 0:
xpad = (rollx,0)
xtrim = slice(0,-rollx)
else:
@mackwage
mackwage / windows_hardening.cmd
Last active September 9, 2024 19:22
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@jiewpeng
jiewpeng / add_anaconda_right_click_menu.md
Last active September 5, 2024 23:03
Add Anaconda Prompt to Windows right click context menu

This gist describes how to add Anaconda Prompt to the Windows right click context menu. This is because at some point, Anaconda no longer adds itself to the PATH after installation.

  1. Run regedit.exe
  2. Navigate to HKEY_CLASSES_ROOT > Directory > Background > shell
  3. Add a key named AnacondaPrompt and set its value to "Anaconda Prompt Here" (or anything you'd like it to appear as in the right click context menu)
  4. Add a key under this key, called command, and set its value to cmd.exe /K C:\Anaconda3\Scripts\activate.bat (may have to change the activate.bat file to whereever Anaconda is installed)
@kanhua
kanhua / quarter_polar_plot.py
Created October 1, 2017 14:53
Quarter polar plot with matplotlib
"""
Reference:
1. https://gist.github.com/ycopin/3342888
2. http://matplotlib.org/mpl_toolkits/axes_grid/users/overview.html#axisartist
"""
import numpy as np
import matplotlib.pyplot as plt
@shekkbuilder
shekkbuilder / esp32_promisc.c
Created December 30, 2016 01:55 — forked from brainstorm/esp32_promisc.c
esp32 promiscuous mode and packet injection experiments
// Espressif ESP32 promiscuous mode and packet injection experiments
// by brainstorm at nopcode org
#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "lwip/err.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
@brainstorm
brainstorm / esp32_promisc.c
Last active June 16, 2024 14:47
esp32 promiscuous mode and packet injection experiments
// Espressif ESP32 promiscuous mode and packet injection experiments
// by brainstorm at nopcode org
#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "lwip/err.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
@MakerAsia
MakerAsia / ESP32_wifi_dns.c
Last active January 9, 2023 07:15
ESP32 (ESP-IDF) WiFi connect and resolve DNS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "lwip/inet.h"
#include "lwip/ip4_addr.h"
#include "lwip/dns.h"
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
"Name","URL","Blurb","Limitations","Data subject","Formats","Ready to use data formats?","Bulk download?","National","Terms","Terms URL","Notes"
"Dados.gov.pt","http://dados.gov.pt","The official portal for public datasets. Many kinds of national- and local-level data can be found.","Many datasets are high-quality, whereas a few have limited time scopes. ","Many types","CSV, JSON","Yes","Yes","National and local","Open (Creative Commons-Attribution 3.0)","http://www.dados.gov.pt/PT/Info/AvisosLegais.aspx",
"Lisboa Aberta","http://dadosabertos.cm-lisboa.pt/","Official open data portal for Lisbon. Contains more than 200 GeoJSON datasets about various fields of activity, business and leisure.",,"Geo","GeoJSON","Yes","Yes","Local","Open (Creative Commons-Attribution 3.0)","http://dados.cm-lisboa.pt/carta.html",
"One Stop Transport","http://ost.pt","Data provider with real-time transport data in some cities. Makes available a well-documented API for their datasets.","Lisbon is not included in this portal. Needs re
@rashivkp
rashivkp / linkedin-icon-for-jekyll-footer.html
Last active June 21, 2022 06:00
linkedin svg icon for jekyll page footer