Skip to content

Instantly share code, notes, and snippets.

@budRich
budRich / i3get
Last active April 10, 2023 16:32
extract window information from i3 tree
#!/bin/sh
# i3get
#
# search for windows in i3 tree, return desired information
# if no arguments are passed. con_id of acitve window is returned.
# ctrl+c, ctrl+v by budRich 2017
# bash to sh by: nimaje
#
# Options:
@mcoster
mcoster / bib2hugoac.py
Last active September 10, 2018 01:25
bib2hugoac - a python script that takes a .bib file and generates a directory full of .md files for use with the Hugo Academic theme
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script takes a BibTeX .bib file and outputs a series of .md files for use
in the Academic theme for Hugo, a general-purpose, static-site generating web
framework. Each file incorporates the data for a single publication.
Written for and tested using python 3.6.1
@rberenguel
rberenguel / view_html.el
Created December 22, 2013 17:51
Small emacs lisp snippet to open email as HTML in default browser. Found it somewhere over the net, but it is so awesome I need to save it for posterity. In a summary buffer use v h (think of it as "view html") to switch to HTML view. It works by generating a temporary file and stripping the html part of the current message into it.
(defun my-gnus-summary-view-html-alternative ()
"Display the HTML part of the current multipart/alternative MIME message
in current default browser."
(interactive)
(save-current-buffer
(gnus-summary-show-article)
(set-buffer gnus-article-buffer)
(let ((file (make-temp-file "html-message-" nil ".html"))
(handle (nth 3 (assq 1 gnus-article-mime-handle-alist))))
(mm-save-part-to-file handle file)
@amueller
amueller / colors_curves.png
Last active April 20, 2024 01:38
random color palette using halton codes
colors_curves.png
@rossant
rossant / raytracing.py
Last active December 24, 2023 12:50
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@cofi
cofi / gist:3013327
Created June 28, 2012 19:22
Command using Helm to select spelling corrections
(defun cofi/helm-flyspell-correct ()
"Use helm for flyspell correction.
Adapted from `flyspell-correct-word-before-point'."
(interactive)
;; use the correct dictionary
(flyspell-accept-buffer-local-defs)
(let ((cursor-location (point))
(word (flyspell-get-word))
(opoint (point)))
@3demax
3demax / tabbar-tweak.el
Created October 5, 2011 14:58
Emacs tabbar-mode visual tweaks
;; This are setting for nice tabbar items
;; to have an idea of what it looks like http://imgur.com/b0SNN
;; inspired by Amit Patel screenshot http://www.emacswiki.org/pics/static/NyanModeWithCustomBackground.png
;; Tabbar
(require 'tabbar)
;; Tabbar settings
(set-face-attribute
'tabbar-default nil
:background "gray20"