Skip to content

Instantly share code, notes, and snippets.

@DancingQuanta
DancingQuanta / cleanbib.py
Last active August 31, 2015 19:53 — forked from chaosct/cleanbib.py
Script to clean (and sort) the bibfile exported by Mendeley
# Script to clean (and sort) the bibfile exported by mendeley
# It is then apt for versioning
# Author: Carles F. Julià <carles.fernandez(AT)upf.edu>
# You will need bibtexparser package:
# $ pip install bibtexparser
# usage: cleanbib.py library.bib
# WARNING: it overwrites the original file
@DancingQuanta
DancingQuanta / getbibs.py
Last active March 21, 2016 12:36 — forked from wcaleb/getbibs.py
The Pandoc filter and shell script I use to make a bibliography file from my BibTeX note files. See http://wcm1.web.rice.edu/plain-text-citations.html
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Pandoc filter that grabs the BibTeX code block from each note file
# and then uses bibtexparser to add a "short title" entry in the "note" field,
# appending finished BibTeX entry to a bibliography file.
from pandocfilters import toJSONFilter, CodeBlock
# https://github.com/sciunto/python-bibtexparser
import bibtexparser
@DancingQuanta
DancingQuanta / arduinoDataWriter.py
Created May 17, 2016 21:34 — forked from MercuryRising/arduinoDataWriter.py
Python Data Logger from Arduino
import serial
import time
import datetime
UNO = '/dev/ttyACM0'
ser = serial.Serial(UNO, 115200)
repeatTime = 1000 # milliseconds
def writeData(value):
@DancingQuanta
DancingQuanta / bootstrap.sh
Created November 6, 2017 16:57 — forked from elerch/bootstrap.sh
Bootstraps all the things (curl, git, mr, vcsh and dotfiles will exist after running)
#!/bin/sh
# To run this without copy/paste the whole thing:
# curl https://gist.githubusercontent.com/elerch/88ea951c9c4ec4c3c1604b8fc9167e53/raw/bootstrap.sh > bootstrap.sh && sh bootstrap.sh && rm bootstrap.sh
# mr is just a perl script
myrepos="http://source.myrepos.branchable.com/?p=source.git;a=blob_plain;f=mr;hb=HEAD"
# vcsh is just a bash script
vcsh=https://raw.githubusercontent.com/RichiH/vcsh/master/vcsh
@DancingQuanta
DancingQuanta / ini2json.py
Created January 3, 2018 19:41 — forked from Natim/ini2json.py
Convert an ini configuration file into a json file
# -*- coding: utf-8 -*-
import json
import sys
from ConfigParser import (ConfigParser, MissingSectionHeaderError,
ParsingError, DEFAULTSECT)
class StrictConfigParser(ConfigParser):
def _read(self, fp, fpname):
// Written by Nick Gammon
// February 2011
/**
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ).
* This script will capture the SPI bytes, when a '\n' is recieved it will then output
* the captured byte stream via the serial.
*/
#include <SPI.h>