Skip to content

Instantly share code, notes, and snippets.

@hplewis
hplewis / netctl-rit
Last active Aug 16, 2021
netctl config file for RIT's wpa2 enterprise wireless network
View netctl-rit
Description='RITnet'
Interface=
Connection=wireless
Security=wpa-configsection
IP=dhcp
ESSID=RIT
WPAConfigSection=(
'ssid="RIT"'
'key_mgmt=WPA-EAP'
'eap=PEAP'
@mrkgnao
mrkgnao / IosevkaConfigGen.hs
Last active Nov 8, 2022
Render Iosevka ligatures to Private Use Area glyphs, for Emacs
View IosevkaConfigGen.hs
{-# LANGUAGE RecordWildCards, Arrows #-}
import Numeric
import Data.Char
import Control.Monad
import Data.Monoid ((<>))
import Data.List (nub, sort, reverse)
data RepeatBounds = RB
@mpneuried
mpneuried / Makefile
Last active Nov 28, 2022
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
View Makefile
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@pylover
pylover / a2dp.py
Last active Nov 27, 2022
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
View a2dp.py
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@DeLaGuardo
DeLaGuardo / pragmatapro-font-lock-symbols-v2.el
Last active Jun 30, 2021
Snippet for support ligatures from PragmataPro font in Emacs
View pragmatapro-font-lock-symbols-v2.el
;; Enable ligatures without prettify-symbols
(provide 'add-pragmatapro-symbol-keywords)
(defconst pragmatapro-fontlock-keywords-alist
(mapcar (lambda (regex-char-pair)
`(,(car regex-char-pair)
(0 (prog1 ()
(compose-region (match-beginning 1)
(match-end 1)
@ashander
ashander / unfavorite.js
Last active Nov 8, 2022
Delete all your favorites (unfavorite or unlike every tweet) on twitter.com (thx to @JamieMason and @b44rd for inspiring this)
View unfavorite.js
// 1. Go to https://twitter.com/i/likes
// 2. Keep scrolling to the bottom repeatedly until all your favs are loaded.
// 3. Run this in your console (open in chrome by View > Developer > JavaScript Console)
// Notes: this may take a while if you have a lot of favs/likes
// you can only access your most recent ~2000 likes.
// inspired by https://gist.github.com/JamieMason/7580315
$('.ProfileTweet-actionButtonUndo').click()
View pep8_cheatsheet.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@softwaredoug
softwaredoug / ubuntu_py3.md
Last active Nov 9, 2021
Ubuntu 14.04 Python 3.4.2 Setup using pyenv and pyvenv
View ubuntu_py3.md

What I did to get Python 3.4.2 on Ubuntu 14.04. The stock version of Python 3 on Ubuntu is 3.4.0. Which is missing some of the best parts! (asyncio, etc). Luckily I discovered pyenv which solved my problem.

Install pyenv

Pyenv (not to be confused with pyvenv) is the Python equivelant of rbenv. It lets you configure which Python environment/version is available per directory, user, or other session variables.

I followed the instructions here to install pyenv in my home directory. Verbatem, those instructions are:

sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
@alexmurray
alexmurray / ec
Last active Jan 24, 2022
Start Emacs Client in GUI (and launch Emacs server if not already running)
View ec
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@stefansundin
stefansundin / install-pre-push.sh
Last active Jul 6, 2022
Git pre-push hook to prevent force pushing the master/main branch.
View install-pre-push.sh
#!/bin/bash
# This script will install a Git pre-push hook that prevents force pushing the master/main branch.
# There are three variants that I have built:
# - pre-push: prevents force-pushing to master/main.
# - pre-push-2: prevents force-pushing to master/main depending on the remote (you need to edit the file!).
# - pre-push-3: prevents any type of pushing to master/main.
# Set the desired version like this before proceeding:
# FILE=pre-push
# Single repo installation: