Skip to content

Instantly share code, notes, and snippets.

View kbond's full-sized avatar

Kevin Bond kbond

View GitHub Profile
@kbond
kbond / form.html.twig
Created November 13, 2014 12:51
translate symfony button labels
{% block button_widget -%}
{% if label is empty -%}
{% set label = name|humanize %}
{%- endif -%}
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ label|trans({}, translation_domain)|raw }}</button>
{%- endblock button_widget %}
@kbond
kbond / CHANGELOG-GENERATOR.md
Last active August 29, 2015 13:59
CHANGELOG generator with git

git log --oneline --no-merges --pretty=format:'- %h %s (%an)' $(git describe --tags --abbrev=0)..HEAD

Keybase proof

I hereby claim:

  • I am kbond on github.
  • I am kbond (https://keybase.io/kbond) on keybase.
  • I have a public key whose fingerprint is FD6F A42A 366D 5A5B 3CDD 2428 355D A0B5 7B1E 32E2

To claim this, I am signing this object:

@kbond
kbond / VAGRANT.md
Last active January 2, 2016 00:58
Vagrant Setup

Setup host machine

  1. Ensure VirtualBox and Vagrant are installed.

  2. Install Puppet:

    $ wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
    $ sudo dpkg -i puppetlabs-release-precise.deb
    $ sudo apt-get update

$ sudo apt-get install puppet

@kbond
kbond / ExpressionExtension.php
Last active January 1, 2016 20:39
ExpressionExtension for KnpMenu/KnpMenuBundle
<?php
namespace MyApp\Menu;
use Knp\Menu\Factory\ExtensionInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
@kbond
kbond / .bash_aliases
Last active December 31, 2015 22:59
Show git branch in bash prompt
# Modified from: http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt
################################################################################
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
@kbond
kbond / gruntfile.js
Last active December 31, 2015 03:39
Grunt configuration
module.exports = function (grunt) {
grunt.initConfig({
modernizr: {
devFile: "remote",
outputFile: "web/_static/js/modernizr.js",
files: ["web/js/*", "web/css/*"]
},
jshint: {
options: {
@kbond
kbond / ssh.md
Created April 25, 2013 18:40
Add authorized ssh key
@kbond
kbond / fix_symfony2_permissions.sh
Created January 4, 2012 16:36
Fix Symfony2 Permissions
#!/bin/sh
USER=$(whoami)
APACHE_USER=$(ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {print $1}')
sudo chmod +a "$USER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "$APACHE_USER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
echo "app/cache & app/logs been properly chmod'ed for $USER and $APACHE_USER"
<?php
namespace Zenstruck\eBirdrBundle\Entity\Base;
use Zenstruck\eBirdrBundle\Entity\Page;
use Doctrine\ORM\Mapping as ORM;
/**
* @author Kevin Bond <kevinbond@gmail.com>
*