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
matthewrobertson / gist:7699048
Created Nov 28, 2013
generate oauth tokens
View gist:7699048
require 'oauth'
require 'forwardable'
module Sredder
WRIKE_OAUTH_OPTIONS = {
:site => 'https://www.wrike.com',
:authorize_path => '/rest/auth/authorize',
:access_token_path => '/rest/auth/access_token',
:request_token_path => '/rest/auth/request_token'
@matthewrobertson
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
end
@matthewrobertson
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';
angular.module('medeo.services').
factory('DesktopVidyoApi', ['$rootScope',
function ($rootScope) {
}
]);
@matthewrobertson
matthewrobertson / gist:5239643
Created Mar 25, 2013
JS angular controller
View gist:5239643
(function() {
"use strict";
angular.module('medeo.controllers').
controller('ControllerCtl', ['$scope',
function ($scope) {
}
]);
@matthewrobertson
matthewrobertson / gist:5218277
Created Mar 22, 2013
JS Angularjs Directive Scaffold
View gist:5218277
(function() {
"use strict";
angular.module('caseShow')
.directive('timeAgo', function($timeout) {
var directiveDefinitionObject = {
priority: 0,
template: '<div></div>',
templateUrl: 'directive.html',
replace: false,
View gist:5211070
(function() {
"use strict";
})();
@matthewrobertson
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
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
else
sudo gem install soloist --no-rdoc --no-ri
fi
# create the cookbooks dir and write the soloistrc in it
You can’t perform that action at this time.