Skip to content

Instantly share code, notes, and snippets.

Matthew Robertson matthewrobertson

Block or report user

Report or block matthewrobertson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
matthewrobertson / gist:7699048
Created Nov 28, 2013
generate oauth tokens
View gist:7699048
require 'oauth'
require 'forwardable'
module Sredder
:site => '',
:authorize_path => '/rest/auth/authorize',
:access_token_path => '/rest/auth/access_token',
:request_token_path => '/rest/auth/request_token'
matthewrobertson / base_serializer.rb
Last active Jun 14, 2016
A simple pattern for creating classes that encapsulate JSON serialization logic. Simply inherit from the `BaseSerializer` and override the hook methods as necessary.
View base_serializer.rb
# An abstract base class used to create simple serializers
# for ActiveRecord objects
class BaseSerializer
include Rails.application.routes.url_helpers
attr_reader :serialized_object
def initialize(serialized_object)
@serialized_object = serialized_object
matthewrobertson / gist:5265684
Created Mar 28, 2013
RB relative file path
View gist:5265684
File.expand_path("../../config/application.yml", __FILE__)
View gist:5241184
(function() {
'use strict';
factory('DesktopVidyoApi', ['$rootScope',
function ($rootScope) {
matthewrobertson / gist:5239643
Created Mar 25, 2013
JS angular controller
View gist:5239643
(function() {
"use strict";
controller('ControllerCtl', ['$scope',
function ($scope) {
matthewrobertson / gist:5218277
Created Mar 22, 2013
JS Angularjs Directive Scaffold
View gist:5218277
(function() {
"use strict";
.directive('timeAgo', function($timeout) {
var directiveDefinitionObject = {
priority: 0,
template: '<div></div>',
templateUrl: 'directive.html',
replace: false,
View gist:5211070
(function() {
"use strict";
matthewrobertson / gist:4053020
Last active Oct 12, 2015
GIT delete all local merged branches
View gist:4053020
git branch --merged | grep -v 'master$' | xargs git branch -d
matthewrobertson / setup.bash
Created Nov 1, 2012
cc_workstation kickoff
View setup.bash
pushd `pwd`
# install soloist
if rvm --version 2>/dev/null; then
gem install soloist --no-rdoc --no-ri
sudo gem install soloist --no-rdoc --no-ri
# create the cookbooks dir and write the soloistrc in it
You can’t perform that action at this time.