Skip to content

Instantly share code, notes, and snippets.

View m040601's full-sized avatar

somename123 m040601

View GitHub Profile
@mathematicalcoffee
mathematicalcoffee / chapter.hs
Last active February 23, 2021 07:10
Pandoc extension to insert the metadata of a file as headings of levels 1, 2 and 3. This is so that if you have (say) each chapter of a thesis in its own file with its own title block, you can still compile the lot together to the one final thesis. See the file for more details.
#!/usr/bin/env runhaskell
-- Filter that adds the metadata block as h1, h2, h3 (title, author, date).
--
-- Usage::
-- chmod +x ./chapter.hs
--
-- # (where each chapter is in its own md file and I want to compile them
-- # into one document preserving the title/author/date for each chapter):
--
-- for f in Chapter*.md; do \
@gmccreight
gmccreight / master.vim
Last active November 21, 2024 14:36
A script that gives you a playground for mastering vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@reinholdsson
reinholdsson / Makefile
Last active December 18, 2020 17:04
RMarkdown to PDF with pandoc (using Makefile)
build:
Rscript build.r
clean:
rm -rf *.tex *.tex-e *.bbl *.blg *.aux *.out *.log *.spl plots/ cache/ *.gz\(busy\) *.gz *.pdf
@ttscoff
ttscoff / grab links.bookmarklet
Last active February 20, 2025 09:55
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@wcaleb
wcaleb / blookup.py
Last active March 20, 2020 22:10
Use OttoBib.com and ISBNdb.com to generate a formatted bibliographic citation from an author-title search string. More explanation here: <http://wcm1.web.rice.edu/get-citations-with-isbndb-and-ottobib.html>
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# blookup.py
# by Caleb McDaniel <http://wcm1.web.rice.edu>
# Uses ottobib.com and isbndb.com to turn an author-title search string
# into a formatted bibliographic citation.
# Example:
# blookup.py "blight race and reunion"
@astanin
astanin / Direct_Links_in_Google_Search.user.js
Created September 25, 2012 14:52
Remove indirections from Google search results on all TLDs (GreaseMonkey script)
@josephwecker
josephwecker / new_bashrc.sh
Created August 11, 2012 04:36
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
@lmullen
lmullen / brownson-orestes.yml
Created May 2, 2012 21:43
Modeling historical events in YAML and Ruby
# A model of a convert's life
---
name-last : Brownson
name-first : Orestes Augustus
born : 1803-09-16
died : 1876-04-17
birth-religion : Congregationalism
conversions :
@xlson
xlson / del2scrumptious.groovy
Created December 27, 2010 12:20
Script that transforms the Delicious backup-xml into json for import into the CouchDB application Scrumptious
#!/usr/bin/env groovy
@Grab(group='commons-lang', module='commons-lang', version='2.5')
@Grab(group='net.sf.ezmorph', module='ezmorph', version='1.0.6')
@Grab(group='commons-collections', module='commons-collections', version='3.2.1')
@Grab(group='commons-beanutils', module='commons-beanutils', version='1.8.3')
@Grab('net.sf.json-lib:json-lib:2.3-jdk15')
import net.sf.json.*
def cli = new CliBuilder(usage:'del2scrumptious.groovy')
myfile = IO.read("/opt/mybin/mystart")
file "/usr/local/bin/mystart" do
content myfile
end