Skip to content

Instantly share code, notes, and snippets.

@redinger
redinger / Emacs.md
Created November 26, 2011 03:22
Setting up Emacs daemon on OS X

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Cocoa Emacs

Download the latest pretest version of [Emacs for Mac OS X]: http://emacsformacosx.com/builds

@elijahmanor
elijahmanor / index.html
Last active August 10, 2024 22:48
Reveal.js External Markdown
<!doctype html>
<html lang="en">
<!-- ... -->
<body>
<div class="reveal">
<div class="slides">
<section data-markdown="slides.md"
data-separator="^\n---\n$"
data-vertical="^\n------\n$"
data-notes="^Notes:"
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@vkavun
vkavun / enable_disable_do_not_disturb.sh
Last active November 30, 2024 19:53
A simple way to turn off application badges, as well as enabling/disabling "Do Not Disturb" Mode. Some sort of extension for Mac silent mode
#!/bin/bash
# TOGGLING APP BADGE ICONS
# application bundle ids, that need to disable/enable badge app notifications
bundle_ids=(com.skype.skype com.viber.osx com.adiumX.adiumX com.getdropbox.dropbox com.evernote.Evernote com.apple.FaceTime com.apple.iTunes com.apple.mail com.apple.Maps com.apple.Photos com.tinyspeck.slackmacgap ru.keepcoder.Telegram com.shazam.mac.Shazam)
# "Usernoted" = "user notifications daemon", getting its PID.
pid=$(ps aux | grep -i [u]sernoted | awk '{print $2}')
# Finding notification center db
@ericdfields
ericdfields / gist:3d4ed9c7f7b559289a102207facd61a7
Created February 3, 2017 15:30
Add multiple items to an Amazon Cart with a single button
I've seen links around the web for a list of items and a single 'add to amazon cart' button.
I don't know how to do this more easily through an amazon-provided UI, but it seems that you can hack it together through URL params easy enough, like so:
https://www.amazon.com/gp/aws/cart/add.html?AssociateTag=your_tag&tag=your_tagQ&ASIN.1=B012NH05UW&Quantity.1=1&ASIN.2=B012M8LXQW&Quantity.2=1
* ASINs are the string after /dp/ in amazon URLs. (amazon.com/dp/string_is_here)
* Add as URL params w/ incrementing identifiers and quantity couplets (ASIN.1, Quantity.1, ASIN.2, Quantity.2…)
@chasset
chasset / invert-citeproc.py
Created July 9, 2019 14:17 — forked from mbroedl/invert-citeproc.py
Inverse pandoc citeproc from docx to markdown
#!/bin/env python
'''
Due to changes made towards pandoc2, at the moment mostly only the inversion of (some) citations and re-wrapping of lines into somewhat semantic units.
I previously had some pandoc filters that also converted track changes to CriticMarkup, could accept or reject them, and merged comments to footnotes or html comments;
due to the change in pandoc filters they don't work at the moment, so that functionality is not used for now (but it is implemented in the script).
Usage:
@ckandoth
ckandoth / single_machine_slurm_on_ubuntu.md
Last active May 19, 2024 07:49
Install Slurm 19.05 on a standalone machine running Ubuntu 20.04

Use apt to install the necessary packages:

sudo apt install -y slurm-wlm slurm-wlm-doc

Load file:///usr/share/doc/slurm-wlm/html/configurator.html in a browser (or file://wsl%24/Ubuntu/usr/share/doc/slurm-wlm/html/configurator.html on WSL2), and:

  1. Set your machine's hostname in SlurmctldHost and NodeName.
  2. Set CPUs as appropriate, and optionally Sockets, CoresPerSocket, and ThreadsPerCore. Use command lscpu to find what you have.
  3. Set RealMemory to the number of megabytes you want to allocate to Slurm jobs,
  4. Set StateSaveLocation to /var/spool/slurm-llnl.
  5. Set ProctrackType to linuxproc because processes are less likely to escape Slurm control on a single machine config.
@pystardust
pystardust / pdf_contrast.py
Created May 1, 2022 21:09
Change contrast of pdf using python
"""
# pdf_contrast.py
Modify contrast of pdf
## Install
```
pip install Pillow pdf2image img2pdf tqdm
```
> Save this file as pdf_contrast.py
@jthaman
jthaman / consult-ripgrep-all.el
Last active November 10, 2025 12:26
Call ripgrep-all in emacs with consult
;; New versions of consult make this dramatically simpler than it used to be. Just one function that you can bind to a key:
;;;###autoload
(defun consult-ripgrep-all (&optional dir initial)
(interactive "P")
(let ((consult-ripgrep-args "rga --null --line-buffered --color=never --max-columns=1000 --smart-case --no-heading --with-filename --line-number"))
(consult-ripgrep dir initial)))
@dbreunig
dbreunig / podcast-to-transcript-to-sqlite.py
Created February 15, 2023 19:05
Download podcasts from an XML feed, transcribe them with whisper, and insert the data into a sqlite db.
import feedparser
import whisper
import sqlite3
import requests
podcast_feed_url = "https://feeds.libsyn.com/92106/rss"
db_name = "podcast.db"
# Create the database and its tables.
con = sqlite3.connect(db_name)