Skip to content

Instantly share code, notes, and snippets.

View johnkary's full-sized avatar

John Kary johnkary

View GitHub Profile
{# ./src/Acme/DemoBundle/Resources/view/Survey/_question.html.twig #}
{#
Template for rendering a radio button
#}
<div class="question">
{{ form_errors(widget) }}
{{ form_label(widget, label, {'attr': {'class':'question_text'} }) }}
{{ form_widget(widget) }}
</div>
@johnkary
johnkary / gist:2890651
Created June 7, 2012 18:34
List of Symfony Live 2012 - Paris slides
Day 1 (Track A):
Keynote - Fabien Potencier
Security: In Real Life - Johannes S
https://speakerdeck.com/u/schmittjoh/p/security-in-real-life
How we built the new responsive BBC News site - John Cleveley
https://speakerdeck.com/u/jcleveley/p/how-we-built-the-new-responsive-bbc-news-site
@johnkary
johnkary / git-alias-files.sh
Created June 14, 2012 16:06
Showing only files for a single commit
git config --global alias.hellobrian '!git --no-pager show --pretty="format:" --name-only'
Usage: git hellobrian c22e54d0ee0819f9d548b9249bed8998aa0107fb
Comments: The "!git" part isn't needed for all aliases, only in this case because your command changes environment variables, so it will expand "git" on execution. Usually you start an alias with "log --some-option --second-option"
@johnkary
johnkary / gist:2981125
Created June 24, 2012 02:33
Misko Hevery - Clean Code Talks
Clean Code Talks
by Misko Hevery
Unit Testing
http://www.youtube.com/watch?v=wEhu57pih5w
Don't Look For Things!
http://www.youtube.com/watch?v=RlfLCWKxHJ0
Inheritance, Polymorphism, & Testing
@johnkary
johnkary / WSSoapClient.php
Created June 27, 2012 20:08
WS-Security for PHP SoapClient
<?php
/**
* Copyright (c) 2007, Roger Veciana
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
@johnkary
johnkary / .bash_profile
Created July 11, 2012 20:53
Hide or show icons on Mac via a CLI command
alias hideicons="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showicons="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
@johnkary
johnkary / soapz0r.php
Created July 12, 2012 17:04
PHP \SoapClient with Exception tracing
<?php
$client = new \SoapClient('https://domain.com/path/to/service.wsdl', array(
'exceptions' => TRUE,
'trace' => TRUE,
'soap_version' => SOAP_1_1,
'location' => 'https://domain.com/path/to/endpoint',
));
@johnkary
johnkary / Vagrantfile
Created September 28, 2012 16:05
Acme Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"
public static $types = array(
'a' => 'Option A',
'b' => 'Option B',
);
public static function getTypeChoices()
{
return self::$types;
}
@johnkary
johnkary / demo.md
Created November 10, 2012 19:47
Simple code highlighting for presentations
highlightkeynote() { highlight --font=Monaco --font-size=24 --style=johnkary -i "$@" -O rtf ;}

The --style=johnkary option is a custom color scheme I've created. You can see all the color schemes that ship with highlight by doing:

ls `brew --prefix highlight`/share/highlight/themes

Copy one of the themes and make your own modifications.