Skip to content

Instantly share code, notes, and snippets.


Nicolas Hasbun nhasbun

  • Santiago, Chile
View GitHub Profile
nhasbun / msys2-here-uninstall.reg
Created Sep 25, 2020 — forked from elieux/msys2-here-uninstall.reg
MSYS2 here context menu items
View msys2-here-uninstall.reg
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW32 here]
nhasbun / *
Created Jul 20, 2020 — forked from rszeto/*
Setting up PyCharm project with remote interpreter
View *

Setting up PyCharm project with remote interpreter

Setting up a remote interpreter on PyCharm is awfully unintuitive. I've pared it down to what I think is the minimal number of steps, and leaves the fewest number of deployment configurations and Python interpreters lying around. This is designed for my specific configuration (specifically PyTorch); adapt as needed.

Configuring default project (only do after installing PyCharm for the first time):

  1. (Optional) Add virtual environment path to excluded files
    1. From Welcome Page, go to Configure > Settings > Build, Execution, Deployment > Deployment > Options
    2. Add virtualenv path. For example, if you always have the project's virtualenv in .env, add ";.env" to the "Exclude items by name" field
nhasbun / useful_c_macros.h
Created Jun 10, 2019
Collection of useful C macros
View useful_c_macros.h
#define BIT(x,n) (((x) >> (n)) & 1)
#define INSERT_BITS(original, mask, value, num) (original & (~mask)) | (value << num)
#ifdef __ASSEMBLY__
#define CAST(type, value) value
#define CAST(type, value) ((type)(value))
nhasbun / clean_ad_association.bat
Created Feb 23, 2019
Clean some invasive Altium Designer file associations.
View clean_ad_association.bat
@echo off
rem Altium Designer is quite invasive regarding file associations taking control all over the place.
rem This script put some stuff in place.
rem assoc and ftype can be run standalone to get a list if you need to clean
rem more associations...
@echo on
assoc .asm=
assoc .c=
View Mikrotik - Microsoft telemetry block
/ip firewall filter
add action=reject chain=forward comment="Reject MS Telemetry" \
dst-address-list=MStelemetry reject-with=icmp-network-unreachable
/ip firewall address-list
add address= list=MStelemetry
add address= list=MStelemetry
add address= list=MStelemetry
add address= list=MStelemetry
add address= list=MStelemetry
View Makefile
# Hello, and welcome to makefile basics.
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
# Once you're done here, go to
# to learn SOOOO much more.
nhasbun / debouncer.v
Created Nov 1, 2017
Debouncer genérico en Verilog
View debouncer.v
Modulo debouncer generico
Author : Nicolas Hasbun
File : debouncer.v
Create : 2017-11-01 05:16:35
Editor : sublime text3, tab size (2)
nhasbun / __project.sublime-project
Created Oct 10, 2017
Sublime text project file for Verilog
View __project.sublime-project
"path": "."
nhasbun / .gitignore
Last active Jun 2, 2021
Git ignore file for quartus II projects
View .gitignore
# Working with Altera Quartus II (Q2) and do proper versioning is not that easy
# but if you follow some rules it can be accomplished. :)
# This file should be placed into the main directory where the .qpf file is
# found. Generally Q2 throws all entities and so on in the main directory, but
# you can place all stuff also in separate folders. This approach is followed
# here. So when you create a new design create one or more folders where your
# entities will be located and put a .gitignore in there that overrides the
# ignores of this file, e.g. one single rule stating "!*" which allows now all
# type of files. When you add a MegaFunction or another entity to your design,
# simply add it to one of your private folders and Q2 will be happy and manage
nhasbun / fftsinglesideband.m
Created May 23, 2016
Single Side Band FFT for Matlab
View fftsinglesideband.m
function [resultado n]=fftsinglesideband(senal);
%% Funcion que retorna una FFT de Single Side
% ademas retorna n, la cantidad de puntos
% considerados para la FFT
% set de frecuencias se puede generar
% usando
% frecuencias =SAMPLING*(0:(n/2))/n;