Skip to content

Instantly share code, notes, and snippets.

View grantwhitaker06's full-sized avatar

Grant Whitaker grantwhitaker06

View GitHub Profile
@xkr47
xkr47 / letsencrypt-jetty.sh
Last active June 26, 2024 09:03
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
# don't need the PKCS#12 file anymore
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
RedactorPlugins.fontsize = {
init: function(){
var doc = document;
if ( !doc.getElementById( 'redactor-fontsize-style' ) ) {
var head = doc.getElementsByTagName( 'head' )[0];
var imgsrc = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAASCAMAAACZ8IWSAAAAA3NCSVQICAjb4U/gAAAAgVBMVEX///////9VVVX///96enpVVVVVVVVVVVX///9VVVX////Hx8erq6tVVVXo6OhVVVVVVVX////e3t5aWlpVVVX////e3t5VVVX////U1NRVVVV6enpaWlpVVVWrq6uVlZVubm5aWlpVVVVycnJubm5mZmZaWlpVVVWrq6tmZmZVVVU4bmHEAAAAK3RSTlMAEREiIiIzRFVVZmZmZnd3iJmZmZmqqqq7u7vMzMzd3d3d3e7u7u7u////6dkbcAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAACGSURBVBiVrc7JFoIwDAXQIA5YpyKiQalgHSjv/z+QwrKpx41vkUVuk5ToD0Gsac0oLGEFnDFGyOmDe8JgFlP2hlcW27bWlV9HJOWyVQ80ibw/69raoFdSdgXnR6CSct345zWaNISlyf0JjX4fwKHDc0HaAu95QBmzH1Ilcxn53s84577SVAdK6gqHkfp1SQAAAABJRU5ErkJggg==';
@jonathonbyrdziak
jonathonbyrdziak / AddressHelper.php
Created August 18, 2010 20:20
Parse Address :: This function is designed to parse a complete street address using PHP. If it can't figure out the parsing itself, then it sends the address to google to have google parse the street address.
<?php
/**
* @author Jonathon Byrd
* @package Address Parsing
*
*
*/
class AddressHelper extends ObjectBase
{
/**