Skip to content

Instantly share code, notes, and snippets.

SUMMARY
I like to use kcachegrind for doing profiling on my ruby code. Most of my development
is done on OSX, and while you can install kcachegrind via macports, it takes forever
because it has to build KDE, as well. Much to my surprise, the fine folks who
wrote kcachegrind also made a QT version, qcachegrind. I was able to build this on
OSX without too much effort, only having to install QT and GraphViz. Yippie!
I'm running OSX 10.6.7, with Xcode 4. My default gcc/g++ version is 4.2. I'm sure
it will build just fine on earlier versions of Xcode, but I haven't tested it.
@jeremymarc
jeremymarc / innobackupex-restore.sh
Created December 4, 2012 14:27 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
@jeremymarc
jeremymarc / innobackupex-restore.sh
Created November 2, 2012 18:35 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
@jeremymarc
jeremymarc / RelDate.php
Created October 19, 2012 18:13 — forked from arnaud-lb/RelDate.php
4 lines relative date formatter with DateInterval and Symfony2 Translator
<?php
use Symfony\Component\Translation\TranslatorInterface;
function format(\DateTime $date, TranslatorInterface $translator)
{
$diff = date_create()->diff($date);
$seconds = $diff->days * 86400 + $diff->h * 3600 + $diff->i * 60 + $diff->s;
$format = $translator->transChoice('reldate', $seconds);
@jeremymarc
jeremymarc / github-autodeploy.rb
Created September 19, 2012 15:33 — forked from tedsparc/github-autodeploy.rb
Github post-receive hook for auto-deployment of a Web site document root
require "rubygems"
require "sinatra"
require "json"
# Configure this with the directory path for the Web server's clone of the Git repo
git_dir = '/var/www/origin.git'
# Configure the mappings between Git branches and Web document roots
branch_to_working_directory = {
'www' => '/var/www/www.example.com',
@jeremymarc
jeremymarc / gist:3694602
Created September 10, 2012 23:02 — forked from fennb/gist:1283573
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
<?php
namespace Clever\Presenter\CoreBundle\Assetic\Filter;
use Assetic\Filter\BaseCssFilter;
use Assetic\Asset\AssetInterface;
/**
* Fixes relative CSS urls.
* Support of Symfony relative bundles url
@jeremymarc
jeremymarc / config_dev.yml
Created July 24, 2012 17:52 — forked from havvg/config_dev.yml
optionally import Symfony2 configuration
imports:
- { resource: parameters_dev.yml }
- { resource: config.yml }
- { resource: config_local.yml, ignore_errors: true }
framework:
profiler:
only_exceptions: false
web_profiler:
@jeremymarc
jeremymarc / logrotate.conf
Created July 13, 2012 20:05 — forked from arnaud-lb/logrotate.conf
backuprotate
/var/lib/redis/dump.rdb {
# rotate every day and keep 30 backups
daily
rotate 30
missingok
# rename backups dump.rdb-YYYYMMDD
# instead of dump.rdb.X: more rsync friendly
dateext
# create a new dump
postrotate
@jeremymarc
jeremymarc / GzipFilter.php
Created July 10, 2012 17:36 — forked from timewasted/GzipFilter.php
Assetic gzip filter
<?php
namespace Assetic\Filter;
use Assetic\Asset\AssetInterface;
use Assetic\Util\ProcessBuilder;
/**
* Runs assets through gzip.
*/