Skip to content

Instantly share code, notes, and snippets.

View kbond's full-sized avatar

Kevin Bond kbond

View GitHub Profile
@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>
*
@kbond
kbond / post.md
Created June 8, 2011 19:59
Mount a shared folder automatically in Ubuntu with VirtualBox

Edit your /etc/fstab:

sudo nano /etc/fstab

Add the following:

[NAME]             [MOUNT_POINT]        vboxsf  rw              0       0

Where [NAME] is the name setup in the virtual machine settings and [MOUNT_POINT] is the path in the guest OS (Ubuntu) you want the shared folder located.

@kbond
kbond / gist:dc235c9caf3693e9133c
Created August 11, 2015 12:59
Slow to start jenkins thread dump
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.80-b11 mixed mode):
"Attach Listener" daemon prio=10 tid=0x00007f297406f800 nid=0x4b6 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"RequestHandlerThread[#15]" daemon prio=10 tid=0x00007f2974004800 nid=0x4a9 waiting on condition [0x00007f2988212000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000f09953e0> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
@kbond
kbond / gist:b673d053666c39233d6d
Last active August 29, 2015 14:27
No start jenkins thread dump
Debugger attached successfully.
Server compiler detected.
JVM version is 24.80-b11
Deadlock Detection:
No deadlocks found.
Thread 3631: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
- java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) @bci=20, line=226 (Compiled frame)
@kbond
kbond / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console