Skip to content

Instantly share code, notes, and snippets.

View flanger001's full-sized avatar
🧱

David Shaffer flanger001

🧱
View GitHub Profile
@alexymik
alexymik / RetailMeNot Unsubscribe Python Script
Created September 12, 2020 02:25
Python script to unsubcribe an apartment building from RetailMeNot mail flyers. Requires AntiCaptcha API key
import cloudscraper
import pprint
import names
import time
UNSUBSCRIBE_URL = 'https://www.retailmenot.com/responsive/ajax/UnsubscribeMailerQueue.php'
APARTMENT_MAX_FLOOR = 6
APARTMENT_MAX_UNIT = 7
@flanger001
flanger001 / mysql
Last active April 13, 2022 12:51
Installing MySQL on macOS
MySQL
If the mysql2 gem fails to install, be sure your Xcode Command Line Tools are installed:
$ xcode-select --install
Then try reinstalling the gem with either of these 3 commands:
$ gem install mysql2 -- \
--with-cflags=\"-I$(brew --prefix)/opt/openssl/include\" \
@jodosha
jodosha / benchmark.rb
Created July 22, 2020 07:37
Ruby Method Overloading
require "benchmark/ips"
require_relative "./method_overloading"
class Foo
include MethodOverloading
def call(number)
"foo #{number}"
end
end
@djfdyuruiry
djfdyuruiry / README.md
Last active March 7, 2024 16:35
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@zkat
zkat / index.js
Last active March 10, 2024 14:32
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active April 19, 2024 12:30
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems