Skip to content

Instantly share code, notes, and snippets.

View amaurycatelan's full-sized avatar
🌻
what's up, doc?

Amaury Catelan amaurycatelan

🌻
what's up, doc?
View GitHub Profile
@groverburger
groverburger / init.el
Last active January 2, 2024 04:46
My personal Emacs config file
(setq custom-file (concat user-emacs-directory "auto-custom.el"))
(setq byte-compile-warnings '((not cl-functions)))
;(load custom-file 'noerror)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; set up and make sure packages are installed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
@ro6ley
ro6ley / simple_calculator.py
Last active July 6, 2022 13:44
Unit Testing in Python using UnitTest Framework
#!/usr/bin/env python3
class SimpleCalculator:
def sum(self, a, b):
""" Function to add two integers """
if isinstance(a, int) and isinstance(b, int):
return a + b
else:
return "ERROR"
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active September 16, 2024 13:26
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@ThYpHo0n
ThYpHo0n / .zshrc
Last active August 5, 2024 01:37
WSL(2) bash profile helpers
# WSL?
if [[ "$(< /proc/sys/kernel/osrelease)" == *microsoft* ]]; then
export $(dbus-launch)
export LIBGL_ALWAYS_INDIRECT=1
export WSL_VERSION=$(wsl.exe -l -v | grep -a '[*]' | sed 's/[^0-9]*//g')
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export DISPLAY=$WSL_HOST:0
# pip path if using --user
export PATH=$PATH:$HOME/.local/bin
# SSH
@dataserver
dataserver / exportSecretFromAuthy.md
Last active August 12, 2019 05:08
Exporting Secret code from Authy to other password managers
@nmurthy
nmurthy / getTotps.js
Created January 30, 2019 20:56
export authy totp codes
/* base32 */
/*
Copyright (c) 2011, Chris Umbel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
const axios = require('axios')
const igHandle = 'jennieramida'
const sessionId = '9218400%3AGJqz0Eewttl0x8%3A13'
const Cookie = `sessionid=${sessionId}`
let i = 0
async function requestUserData () {
const url = `https://www.instagram.com/${igHandle}/?__a=1`
console.info(`Making request to: ${url}`)
@santiagobasulto
santiagobasulto / README.md
Last active May 16, 2021 10:13
Download HumbleBundle books in batch with a simple Python script.

Download HumbleBundle books

This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.

(Final Result: books downloaded)

@duhaime
duhaime / headless.py
Last active February 16, 2023 23:19
Python Selenium Headless Chrome OSX
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.binary_location = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
driver = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver', chrome_options=chrome_options)
driver.get("http://www.duo.com")