Skip to content

Instantly share code, notes, and snippets.

View marbemac's full-sized avatar

Marc MacLeod marbemac

View GitHub Profile
@marbemac
marbemac / gist:06c5040e4d71694f07b3
Created September 8, 2014 21:08
Ember.js custom serializer for consistent JSON root
// API return format is as so:
// {
// data: [
// {
// name: 'foo'
// },
// {
// name: 'bar'
// }
// ]
@marbemac
marbemac / Node Linode Stackscript
Created October 11, 2013 01:34
Linode stackscript to setup node, deployer user, git, private networking, basic security, coffee script, and pm2 for node process management.
#!/bin/bash
# <UDF name="user_name" label="Unprivileged user account name" example="This is the account that you will be using to log in or deploy (deployer)." default="deployer" optional="false" />
# <UDF name="user_password" label="Unprivileged user password" optional="false" />
# <UDF name="user_sshkey" label="Public Key for user" default="" example="Recommended method of authentication. It is more secure than password log in." optional="false" />
# <UDF name="user_shell" label="Shell" oneof="/bin/zsh,/bin/bash" default="/bin/bash" />
# <UDF name="sys_hostname" label="System hostname" default="myvps" example="Name of your server, i.e. linode1." optional="false" />
# <UDF name="sys_private_ip" Label="Private IP" default="" example="Configure network card to listen on this Private IP (if enabled in Linode/Remote Access settings tab). See http://library.linode.com/networking/configuring-static-ip-interfaces" optional="false" />
USER_GROUPS=sudo
@marbemac
marbemac / StackScript.sh
Last active December 24, 2015 21:09 — forked from visnup/StackScript.sh
use coffee, remove knockout public key
#!/bin/bash
# <UDF name="user_name" label="Unprivileged user account name" example="This is the account that you will be using to log in or deploy (deployer)." default="deployer" optional="false" />
# <UDF name="user_password" label="Unprivileged user password" optional="false" />
# <UDF name="user_sshkey" label="Public Key for user" default="" example="Recommended method of authentication. It is more secure than password log in." optional="false" />
# <UDF name="user_shell" label="Shell" oneof="/bin/zsh,/bin/bash" default="/bin/bash" />
# <UDF name="sys_hostname" label="System hostname" default="myvps" example="Name of your server, i.e. linode1." optional="false" />
# <UDF name="sys_private_ip" Label="Private IP" default="" example="Configure network card to listen on this Private IP (if enabled in Linode/Remote Access settings tab). See http://library.linode.com/networking/configuring-static-ip-interfaces" optional="false" />
USER_GROUPS=sudo
START a=node(1), b=node(2), c=node(3), d=node(4)
MATCH pa=shortestPath( a<-[:RELATED|TYPE_OF]->b ), pb=shortestPath( b<-[:RELATED|TYPE_OF]->c ) # etc ... Do I really need to make all of these combos...?
RETURN (SUM(affinities along the paths) / length(pa/pb/etc)) as association_strength # No idea how to do this part. I need to sum the "weight" property of the affinity connections along the paths discovered in the match clause, and then divide that sum by the length of the path
ORDER BY association_strength desc
@marbemac
marbemac / nokogiri
Created September 26, 2011 16:57 — forked from fabioyamate/nokogiri
nokogiri installation from libxml2 and libxslt macosx
# using rvm with ruby-1.9.2-p290
# latest version 2.7.8 2011-09-20
brew install libxml2
# installing libxslt from source code
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.8
make
sudo make install
<?php
namespace Limelight\JanrainBundle\Security\User\Provider;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;