Skip to content

Instantly share code, notes, and snippets.

View FrancescElies's full-sized avatar

Francesc Elies FrancescElies

  • 15:17 (UTC +01:00)
View GitHub Profile
@FrancescElies
FrancescElies / cargo.toml
Created August 15, 2024 07:59 — forked from LGUG2Z/cargo.toml
winevent-tracker
[package]
name = "winevent-tracker"
version = "0.1.0"
edition = "2021"
[dependencies]
clearscreen = "3"
windows = { version = "0.54", features = [
"Win32_Foundation",
"Win32_System_Threading",
@FrancescElies
FrancescElies / .ideavimrc
Created August 13, 2024 10:32 — forked from LGUG2Z/.ideavimrc
My ideavimrc
" Map the leader key to space
let mapleader = " "
set clipboard=unnamed " Use system clipboard
set display+=lastline " Always try to show a paragraphΓÇÖs last line
set formatoptions+=j " Delete comment character when joining commented lines
set gdefault " Replace all instances on a line when using :s/regex/replacement
set history=1000 " Remember more commands and search history
set ignorecase " Case-insensitive search
set incsearch "Show matches as search proceeds
@FrancescElies
FrancescElies / conf.hjson
Last active January 16, 2023 05:52
broot
###############################################################
# This configuration file lets you
# - define new commands
# - change the shortcut or triggering keys of built-in verbs
# - change the colors
# - set default values for flags
# - set special behaviors on specific paths
# - and more...
#
# Configuration documentation is available at
@FrancescElies
FrancescElies / config.toml
Last active June 14, 2023 14:49
helix editor
# theme = "adwaita-dark"
theme = "sonokai"
[editor.file-picker]
hidden = false
[editor.whitespace]
# render = "all"
render = "none"
@FrancescElies
FrancescElies / wh.py
Last active June 29, 2022 14:12
A where command for windows
"""A where command for windows, inspired by https://nedbatchelder.com/code/utilities/wh_py.html"""
import argparse
import os
import sys
from pathlib import Path
assert sys.version_info > (3, 10)
def main():
parser = argparse.ArgumentParser(
#!/usr/bin/env python3
"""
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't
@FrancescElies
FrancescElies / nginxproxy.md
Created May 16, 2019 10:41 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@FrancescElies
FrancescElies / large_empty.pyx
Created November 3, 2016 22:51 — forked from kiyo-masui/large_empty.pyx
Hack for allocating larger than memory numpy arrays. For an explanation of how this is useful see http://www/~kiyo/blog.html#memory.
"""Hack for allocating larger than memory numpy arrays."""
import numpy as np
# Cython import
cimport numpy as np
cimport cython
np.import_array() # Exposes the numpy c-api.
# We will do everything in double precision.
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]