Skip to content

Instantly share code, notes, and snippets.

View tofumatt's full-sized avatar

Matthew Riley MacPherson tofumatt

View GitHub Profile
npm install
npm http GET https://registry.npmjs.org/uglify-js
npm http GET https://registry.npmjs.org/acorn/0.4.0
npm http GET https://registry.npmjs.org/clean-css
npm http GET https://registry.npmjs.org/less
npm http GET https://registry.npmjs.org/stylus
npm http GET https://registry.npmjs.org/commonplace/0.2.4
npm http 200 https://registry.npmjs.org/uglify-js
npm http GET https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.24.tgz
npm http 200 https://registry.npmjs.org/acorn/0.4.0
django.request:ERROR Internal Server Error: /api/auth/sign-in/ :/opt/rh/python27/root/usr/lib/python2.7/site-packages/django/core/handlers/base.py:256
Traceback (most recent call last):
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/rest_framework/views.py", line 452, in dispatch
response = self.handle_exception(exc)
@tofumatt
tofumatt / podcast-extract.php
Created July 14, 2015 18:23
Podcast RSS URL Extract
<?php
/*
* Podcast URL Extractor
* implemented at http://itunes.so-nik.com
*
* All code has been re-written by lasavior.
* Original code & inspiration from Michael Sitarzewski, zerologic.com
*
* Ex: http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewPodcast?id=269238657
i have key/value pairs stored via localforage by the main page, but i cant figure out how to bring up a list of keys for the about page. ng-repeat and ng-option dont seem to work, and i suspect it's because i'm not unwrapping my promises correctly? i dunno.
angular.module('scratchpadApp')
.controller('AboutCtrl', function ($scope, $localForage) {
var getKeys = function() {
localforage.keys()
.then(function(result) {
console.log(result);
$scope.getKeys = result;
@tofumatt
tofumatt / models.js
Last active August 29, 2015 14:11
Trying to do offline data with ember-data
import DS from 'ember-data';
var Checkin = DS.Model.extend({
shout: DS.attr('string'),
user: DS.belongsTo('user'),
venue: DS.belongsTo('venue'),
createdAt: DS.attr('date')
});
var User = DS.Model.extend({
Ember.Controller.extend({
actions: {
resort: function(columnName) {
// do stuff with your data here
var stuff = STUFF();
this.set('whatever', stuff);
}
}
});
class PostingsController < ApplicationController
after_action :verify_authorized, except: [:index, :archived]
after_action :verify_policy_scoped, only: [:index, :archived]
before_action :require_login
def index
@sortorder = params[:sort]
case @sortorder
when 'date-added'
@method = :order, 'created_at DESC'
@tofumatt
tofumatt / podcast.js
Created July 21, 2014 03:33
Backbone Podcasts
/*jshint forin:false, plusplus:false, sub:true */
define([
'zepto',
'underscore',
'backbone',
'app',
'collections/podcasts',
'models/podcast',
'views/dialogs',
'views/episode',
@tofumatt
tofumatt / manifest.webapp
Created April 4, 2014 18:08
Manifest for IRCCloud
{
"version": "1.0",
"name": "IRCCloud",
"description": "SOME DESCRIPTION",
"icons": {
"32": "/img/icon-32.png",
"60": "/img/icon-60.png",
"64": "/img/icon-64.png",
"90": "/img/icon-90.png",
"120": "/img/icon-120.png",
@tofumatt
tofumatt / test.backbone.coffee
Created March 17, 2014 16:32
Old backbone tests
'use strict'
casper.test.begin "Testing Backbone data adapter", (test) ->
casper.start "#{casper.TEST_URL}test.backbone.html", ->
test.info "Testing using global scope (no require.js)"
test.assertEval ->
typeof Backbone.localforage is 'object'
, "localforage storage adapter is attached to Backbone.localforage"