Skip to content

Instantly share code, notes, and snippets.

View ejmg's full-sized avatar
💾

ejmg ejmg

💾
View GitHub Profile
@hplewis
hplewis / netctl-rit
Last active August 16, 2021 17:26
netctl config file for RIT's wpa2 enterprise wireless network
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 November 8, 2022 18:28
Render Iosevka ligatures to Private Use Area glyphs, for Emacs
{-# 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 April 19, 2024 21:06
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# 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 March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /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 February 28, 2024 01:27
Snippet for support ligatures from PragmataPro font in Emacs
;; 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 December 7, 2022 01:37
Delete all your favorites (unfavorite or unlike every tweet) on twitter.com (thx to @JamieMason and @b44rd for inspiring this)
// 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()
@RichardBronosky
RichardBronosky / pep8_cheatsheet.py
Created December 27, 2015 06:25
PEP-8 cheatsheet
#! /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 November 9, 2021 19:38
Ubuntu 14.04 Python 3.4.2 Setup using pyenv and pyvenv

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 January 24, 2022 16:56
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/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 October 12, 2023 10:33
Git pre-push hook to prevent force pushing the master/main branch.
#!/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: