Skip to content

Instantly share code, notes, and snippets.

View kbond's full-sized avatar

Kevin Bond kbond

View GitHub Profile

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 / 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

@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 / 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
@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 / 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 / AppKernel.php
Last active August 6, 2024 09:05
JWT Authentication With Symfony Guard. POST username/password to /login to receive token, /api* requests require a valid token
<?php
// app/AppKernel.php
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
public function registerBundles()
{
Verifying that +zenstruck is my blockchain ID. https://onename.com/zenstruck
@kbond
kbond / phpenv.sh
Created November 1, 2016 20:32
Switch between PHP versions
if [ "$1" = "5" ]; then
sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php;
else
sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php;
fi
@kbond
kbond / ExampleTest.php
Last active March 16, 2023 11:44
Laravel Dusk in a non-laravel (Symfony) app
<?php
namespace App\Tests\Browser;
use App\Tests\HasDuskBrowser;
class ExampleTest extends \PHPUnit_Framework_TestCase
{
use HasDuskBrowser;