Skip to content

Instantly share code, notes, and snippets.

{
"folders": [
{
"path": "/home/carlos/Projects/Jampp/Gcd"
},
{
"path": "/home/carlos/Projects/Jampp/Daat"
},
{
"path": "/home/carlos/Projects/Jampp/Leech"
;; -*- eval: (outline-hide-sublevels 6) -*-
;;; Packages
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
; '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(add-hook 'dired-load-hook (lambda () (load "dired-x")))
(package-initialize)
@memeplex
memeplex / extra.js
Created August 2, 2016 20:41
Mkdocs bootswatch tweaks
// Hide sidebar with less than 2 entries.
var sidebar = $('.bs-sidebar')
var entries = sidebar.children().first()
if (entries.children().length <= 1)
sidebar.css('display', 'none')
else {
entries.children(':not(.main)').css('text-indent', '10px')
}
$('h1').css('font-weight', 'bold')
@memeplex
memeplex / base16.py
Last active March 10, 2019 01:29
Base16 default theme for ipython + pygments + prompt toolkit closely matching vim base16 theme.
# -*- coding: utf-8 -*-
"""
Base16 Default Dark by Chris Kempson (http://chriskempson.com).
IPython Template by Carlos Pita (carlosjosepita@gmail.com).
Created with Base16 Builder by Chris Kempson.
"""
from prompt_toolkit.terminal.vt100_output import _256_colors
@memeplex
memeplex / liftup
Last active June 12, 2016 22:04
Liftup
#!/bin/python3
from gcd.nix import sh, sh_quote, path, os, cmd, env
from urllib.parse import quote
from pandocfilters import toJSONFilter, RawInline
def codecogs(key, value, format, meta):
if key == 'Math':
@memeplex
memeplex / custom.js
Created March 27, 2016 19:31
Jupyter notebook vim bindings: .ipython/profile_default/static/custom/custom.js
define([
'base/js/namespace',
'base/js/events',
'jquery',
'codemirror/keymap/vim',
'codemirror/addon/dialog/dialog'
], function(IPython, events, $) {
events.on('app_initialized.NotebookApp', function() {
IPython.keyboard_manager.edit_shortcuts.remove_shortcut('esc');
IPython.Cell.options_default.cm_config.vimMode = true;
@memeplex
memeplex / h2status
Last active May 23, 2016 13:01
h2status is a trivial (about 50 LOC) bash wrapper to i3status that nevertheless allows to conveniently: (i) write custom modules in bash to add full-fledged json entries to the status bar, (ii) write mouse event handlers in bash with access to the full set of event parameters as bash variables, (iii) arbitrarily transform the final output to cha…
#!/bin/bash
function status { :; }
function on_event { :; }
function transform { cat; }
function entry {
echo -ne '{"name":"'$1'","full_text":"'$2'"'${3:+,$3}'},'
@memeplex
memeplex / strapdown.html
Last active December 21, 2015 12:59
A strapdown template with: 1. support for utf8 charset // 2. (optional, i.e. commented out) support for mathjax (with configuration for ascimath which I believe is a kindred spirit to markdown) // 3. fix for bootstrap not honouring table alignment // BTW I can't believe this description is not markdown itself.
<html>
<head>
<title>Title here</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style> /* https://github.com/arturadib/strapdown/issues/25 */
td[align=right] { text-align: right !important; }
td[align=center] { text-align: center !important; }
td[align=left] { text-align: left !important; }