Skip to content

Instantly share code, notes, and snippets.

View pauldub's full-sized avatar
🐱
🇫🇷 🇧🇪

Paul pauldub

🐱
🇫🇷 🇧🇪
View GitHub Profile
@voldmar
voldmar / fill.clj
Created March 27, 2017 13:39
Filling PDF AcroForm with Clojure and iText 7 community edition POF
#!/usr/bin/env boot
; vim: set ft=clojure:
(set-env! :dependencies
'[[com.itextpdf/forms "7.0.2"]])
(import
'[com.itextpdf.forms PdfAcroForm]
'[com.itextpdf.kernel.pdf PdfDocument PdfReader PdfWriter]
'[java.io IOException])
@yoshuawuyts
yoshuawuyts / Q&A.md
Created March 16, 2016 05:58 — forked from novaluke/0-Q&A.md
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@wvengen
wvengen / README.md
Last active March 25, 2024 07:53
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

(require-extension ansi-escape-sequences srfi-19 srfi-1 srfi-13 posix)
(define (reload-config) (load "~/.hiss"))
(define-syntax install (syntax-rules () ((sudo arg1 ...) (_raw sudo apt-get install arg1 ...))))
(define-syntax ! (syntax-rules () ((! arg1 ...) (_raw arg1 ...))))
(define-syntax apt-search (syntax-rules () ((apt-search arg1 ...) (_raw aptitude search arg1 ...))))
(define ++ string-append)
[user]
name = Tsutomu Kuroda
email = t-kuroda@oiax.jp
[alias]
ci = commit
cia = commit --amend
co = checkout
cop = checkout @{-1}
cp = cherry-pick
mf = merge --ff-only
@zardoru
zardoru / fixed_converter
Last active July 13, 2016 14:01
Stepmania converter to osu!mania in c#. fixed a few bugs.
/* use this one. github is not cooperating. */
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
/* god my c# is so messy.
* I'm not fond of proper C#. I rather like C, really
*/
# Prompts
# 30 31 32 33 34 35 36 37
# BK RE GR YE BL MA CY WH
if [ $UID = "0" ]; then
PROMPT="%{%}%n@%m%#%{%} "
else
PROMPT="%{%}%n@%m%#%{%} "
fi
RPROMPT="%{%}[%~]%{%}"
@rastasheep
rastasheep / markdown.md
Created December 10, 2012 02:18
MiniTest quick reference

MiniTest::Spec

use must for positive expectations and wont for negative expectations.

  • must_be | list.size.must_be :==, 0
  • must_be_close_to | subject.size.must_be_close_to 1,1
  • must_be_empty | list.must_be_empty
  • must_be_instance_of | list.must_be_instance_of Array
  • must_be_kind_of | list.must_be_kind_of Enumerable