Skip to content

Instantly share code, notes, and snippets.

@mynameispj
mynameispj / Compass px to em
Created March 10, 2013 22:29 — forked from ijy/Compass px to em
Modified for SASS syntax...
@function em($target, $context: $base-font-size)
@if $target == 0
@return 0
@return $target / $context + 0em
$base-font-size: 16px
@mynameispj
mynameispj / rss-subscribers.sh
Created September 25, 2012 23:33
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default).
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic.
# Required variables:
RSS_URI="/rss"
MAIL_TO="your@email.com"
LOG_FILE="/var/log/httpd/access_log"
def explain!
puts 'Want to embed this Gist?'
puts 'Use this: <script src="http://gist.github.com/2059.js"></script>'
end
explain!
@mynameispj
mynameispj / hack.sh
Created April 4, 2012 13:32 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#