Skip to content

Instantly share code, notes, and snippets.

View msadowski's full-sized avatar

Mateusz Sadowski msadowski

View GitHub Profile
@egelev
egelev / connect_bluetooth_headphones.sh
Last active April 26, 2024 14:14
Connect bluetooth headphones on Ubuntu 18.04
#!/usr/bin/env bash
function get_headphones_index() {
echo $(pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}')
}
function get_headphones_mac_address() {
local temp=$(pacmd list-cards | grep bluez_card -C20 | grep 'device.string' | cut -d' ' -f 3)
temp="${temp%\"}"
temp="${temp#\"}"
@nloadholtes
nloadholtes / stoic-inspiration-emails.py
Created February 25, 2018 20:35
The script I am using to generate daily emails for my Stoic Inspiration mailing list.
from mailchimp3 import MailChimp
import os
import sys
import datetime
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import random
from functools import partial
import json
@sharu725
sharu725 / subscribe-form.html
Last active December 7, 2023 20:36
Jekyll Subscribe Form using Mailchimp
<!--
Before implementing this jekyll snippet make sure
1. you have signed up with Mailchimp.
2. you have created a list in Mailchimp.
3. you have defined the list in _config.yml,
for ex: "mailchimp-list: //redgadgets.us10.list-manage.com/subscribe/post?u=210acce5db69d3d4a04b0e25d&amp;id=08c6708f40"
-->
<form action="{{site.mailchimp-list}}" method="post" name="mc-embedded-subscribe-form" class="wj-contact-form validate" target="_blank" novalidate>
<div class="mc-field-group">
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active April 15, 2024 14:27
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request: