Skip to content

Instantly share code, notes, and snippets.

View catchamonkey's full-sized avatar
👨‍💻

Chris Sedlmayr catchamonkey

👨‍💻
View GitHub Profile
@catchamonkey
catchamonkey / New PC Build.md
Created November 17, 2011 19:03
New PC Build

Cooler Master Elite 430 Case
Intel Core i5 2500K Processor Overclocked to 4.4GHz
Corsair A70 Ultra Quiet CPU Cooler
Asus P8Z68-V LE Motherboard
8GB PC3-10666 1333MHz DDR3 Memory
Chillblast NVIDIA GeForce GTX 560Ti 1024MB Graphics Card
1000GB 7200RPM HDD
Corsair TX 750W PSU
300Mbps 802.11n Wireless PCI Adaptor
OS Dual Boot;

@catchamonkey
catchamonkey / stdInMailer.php
Created November 9, 2011 12:28
Mail your Errors during development without Nagios/Ossec
<?php
// during development you can simply have all Error mentions in your logs (presumably you are logging properly?) mailed to you.
// in production you may be using OSSEC/Nagios etc, but this is a quick win for dev.
// to run, you would do something like
// tail -f /var/log/messages |grep Error | php /home/sites/poc/stdInMailer.php
$fp = fopen("php://stdin","r");
@catchamonkey
catchamonkey / php_get_var_name.php
Created August 31, 2011 11:46
Get the name of a variable in PHP
<?php
class VarName {
function get(&$var, $scope = FALSE, $prefix = 'unique', $suffix = 'value')
{
if($scope) $vals = $scope;
else $vals = $GLOBALS;
$old = $var;
$var = $new = $prefix.rand().$suffix;
@catchamonkey
catchamonkey / skipSpotify.applescript
Created August 11, 2011 15:17
Apple Script to Skip Spotify Track (before my buttons worked)
tell application "System Events" to set appList to name of application processes whose frontmost is true
set activeApp to item 1 of appList
tell application "Spotify" to activate
tell application "System Events"
tell process "Spotify"
click menu item 3 of menu 1 of menu bar item 6 of menu bar 1
end tell
end tell
tell application activeApp to activate
@catchamonkey
catchamonkey / Call List Template
Created August 5, 2011 21:09
calls.html.twig
{% extends "::base.html.twig" %}
{% stylesheets
'@SedlmayrReportsBundle/Resources/public/css/listReport.css'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
{% endstylesheets %}
{% block body %}
@catchamonkey
catchamonkey / Base Layout
Created August 5, 2011 21:04
base.html.twig
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% stylesheets
'@SedlmayrReportsBundle/Resources/public/css/styles.css'
'@SedlmayrReportsBundle/Resources/public/css/reset.css'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
@catchamonkey
catchamonkey / ioreg.battery.sh
Created August 3, 2011 20:54
Display some battery information about your Mac
ioreg -w0 -l | grep -E "Capacity|Cycle Count|DesignCycleCount"
/**
* Provides requestAnimationFrame in a cross browser way.
* @author greggman / http://greggman.com/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.requestAnimationFrame ||
Example: You have a branch 'refactor' that is quite different from master. You can't merge all of the
commits, or even every hunk in any single commit or master will break, but you have made a lot of
improvements there that you would like to bring over to master.
# on master
> git co -b temp
# on temp
> git merge --no-commit --no-ff refactor
@catchamonkey
catchamonkey / gist:780168
Created January 14, 2011 20:24
Blackberry Facebook errors
Warning (2): file_get_contents(https://graph.facebook.com/BlackBerry/posts) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request [APP/controllers/fp_controller.php, line 15]
Notice (8): Trying to get property of non-object [APP/controllers/fp_controller.php, line 20]
Warning (2): Invalid argument supplied for foreach() [APP/controllers/fp_controller.php, line 20]