Skip to content

Instantly share code, notes, and snippets.

View faun's full-sized avatar
🌵

Faun faun

🌵
View GitHub Profile
@faun
faun / decrypt_pdfs
Last active January 28, 2025 15:17
Decrypt all PDFs in a directory using the given password and optionally store the password in the Mac OS system keychain
#! /bin/sh
# Check if qpdf is installed
installed=$(which qpdf &> /dev/null)
if [ $? -eq 1 ]; then
echo >&2 "Please install qpdf first (brew install qpdf)"
exit 1
fi
# Fetch the password from the keychain
@faun
faun / steal.sh
Last active August 29, 2015 13:57 — forked from mislav/steal.sh
Download videos from youtube and add them to iTunes
#!/bin/sh
# Usage: steal <YOUTUBE-URL>
# Requirements: youtube-dl, ffmpeg
set -e
# strip the YouTube playlist
url="${1%%&*}"
if [ -z "$url" ]; then
echo "no URL given" >&2
@faun
faun / Gemfile
Last active January 1, 2016 04:28
Outdated gist related to https://github.com/rails/rails/issues/13304. Move along.
source 'https://rubygems.org'
gem 'activerecord', github: 'rails/rails'
gem 'sqlite3'
gem 'minitest', '~> 5.1'
@faun
faun / vim.rb
Created October 22, 2013 04:38 — forked from mgrouchy/vim.rb
Install with: brew install https://gist.github.com/faun/7095304/raw/1a08f9403196f9e493d8b7a037acff5ed9992348/vim.rb --enable-interp=python,ruby --with-features=big
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
class UsersController < ApplicationController
def create
@user = User.new params[:user]
return render 'new' unless @user.save
flash[:notice] = "The user was created succesfully"
redirect_to :index
end
class UsersController < ApplicationController
def create
@user = User.new params[:user]
return render 'new' unless @user.save
flash[:notice] = "The user was created succesfully"
redirect_to :index
end
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: provide a title argument."
exit -1
else
title="$@"
fi
d=$(date +"%Y-%m-%d")
#!/usr/bin/env bash
set -e
find assets resource -name "*.png" -exec optipng -o7 {} \;
OTTO� �Ä��0CFF U£Ãd��
4��W÷FFTM[O¶‚��då���GDEFZ���b ��� OS/2^«H�� ���`cmap˙À¯��ú��vhead¸Êbp���º���6hheaËn���Ù���$hmtx5d2ö��b,��^maxp-P������nameH$x ��Ä��postˇÜ�3��
��� ����è>⁄8n_<ı� Ë����Õ∏é����Õ∏顇ˇ-v«�������������«ˇ3�»Wˇ‡ˇ·v������������������P�-���WÙ��äº���åäº��‡�1��  ����Ä��/��k��������PfEd�@� ‡≥4ˇL��«�Õ�������“� � �����fi��������õ8��������������1�������*ä�������Ô�������.�������u������� �������!�� ��6���� ��8‘�� ��+�� ��T4�� ��8µ�� ��  �� ��4?�� ��8ê�� ��8Á�C�r�e�a�t�e�d� �b�y� �R�a�p�h� �L�e�v�i�e�n� �u�s�i�n�g� �h�i�s� �o�w�n� �t�o�o�l�s� �a�n�d� �F�o�n�t�F�o�r�g�e�.� �C�o�p�y�r�i�g�h�t� �2�0�0�6� �R�a�p�h� �L�e�v�i�e�n�.� �R�e�l�e�a�s�e�d� �u�n�d�e�r� �t�h�e� �S�I�L� �O�p�e�n� �F�o�n�t� �L�i�c�e�n�s�e�,� �h�t�t�p�:�/�/�s�c�r�i�p�t�s�.�s�i�l�.�o�r�g�/�O�F�L�.��Created by Raph Levien using his own tools and FontForge. Copyright 2006 Raph Levien. Released under the S
@mixin retina($ratio: 1.5) {
$dpi: $ratio * 96;
$opera-ratio: $ratio * 100;
@media only screen and (-webkit-min-device-pixel-ratio: #{$ratio}),
only screen and ( -o-min-device-pixel-ratio: '#{$opera-ratio}/100'),
only screen and ( min-resolution: #{$dpi}dpi),
only screen and ( min-resolution: #{$ratio}dppx) {
@content;
}