Skip to content

Instantly share code, notes, and snippets.

@marsam
marsam / README.md
Last active August 29, 2015 13:56
Create new droplet ansible

Create new droplet:

$ pip install -U ansible dopy
$ ansible-playbook newdroplet.yml
@marsam
marsam / LICENSE
Last active January 4, 2016 15:09
Higgs PKGBUILD
Copyright (c) 2011-2013, Maxime Chevalier-Boisvert. All rights reserved.
This software is licensed under the following license (Modified BSD
License):
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
@marsam
marsam / pdfembed.py
Created November 5, 2013 22:09
pdf embed
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pdfembed
=========
Embed a pdf inside another.
Dependencies:
- pdfrw_
@marsam
marsam / Makefile
Last active December 27, 2015 12:09
.PHONY: clean
all:
python munlima.py --pip --museos
clean-all:
-rm -f *.csv *.geojson
@marsam
marsam / 99.lisp
Created November 5, 2013 15:09
99 lisp problems
;; 99 lisp problems
;; http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html
;; P01
;; * (my-last '(a b c d))
;; (D)
(defun my-last (lst)
(cond
((null lst) nil)
((null (cdr lst)) (list (car lst)))
@marsam
marsam / pdfcrop.py
Last active July 16, 2023 15:16
pdf crop
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pdfcrop
=======
Based on pdfcrop.pl_. Uses the BoundingBox [#]_
Dependencies:
- PyPDF2_
@marsam
marsam / PKGBUILD
Created November 3, 2013 20:48
pkgbuild for vim-jp fork of ctags. https://github.com/vim-jp/ctags
# Maintainer: Mario Rodas <rodasmario2@gmail.com>
pkgname=vim-jp-ctags
pkgver=0.r792.3424a7c
pkgrel=1
pkgdesc="Vim-jp fork of ctags."
arch=('i686' 'x86_64')
license=('GPL')
depends=('glibc')
provides=('ctags')
@marsam
marsam / terminal.py
Created November 1, 2013 17:22
terminal size
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def terminal_size():
width, height = None, None
if sys.platform == 'win32':
import win32utils
width, height = win32utils.get_console_size(defaultx=width, defaulty=height)
#!/usr/bin/env bash
#
# MPRIS: http://xmms2.org/wiki/MPRIS
# Clementine: http://code.google.com/p/clementine-player/wiki/MPRIS
# Amarok: http://amarok.kde.org/wiki/Development/Scripting_HowTo_2.0
#
song_name_clementine() {
qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.GetMetadata | awk '
BEGIN {FS=":"}
#!/usr/bin/env bash
hash acpi >/dev/null 2>&1 || return
HEART_FULL=█
HEART_HALF=▓
HEART_EMPTY=░
NUM_HEARTS=${NUM_HEARTS:-5}
cute_battery() {