Skip to content

Instantly share code, notes, and snippets.

View utx0's full-sized avatar
💭
What's the meaning this?

utx0_ utx0

💭
What's the meaning this?
View GitHub Profile
What is this?? L
@utx0
utx0 / base_controller.rb
Created September 6, 2012 06:44
Devise api help required
# app/controllers/api/v1/base_controller.rb
class Api::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
include Api::V1::SessionsHelper
respond_to :json
before_filter :authenticate_user
@utx0
utx0 / gist:3787912
Created September 26, 2012 13:04
Restkit not mapping back to UserToken object
- (void) postLogin
{
//Setup Login data
UserLogin *l = [[UserLogin alloc] initWithUsername:[usernameField text] andPassword:[passwordField text]];
//Setup Routes
RKObjectRouter *router = [RKObjectManager sharedManager].router;
[router routeClass:[UserLogin class] toResourcePath:@"/api/v1/login" forMethod:RKRequestMethodPOST];
@utx0
utx0 / 2013-04-26-test-post.markdown
Created April 28, 2013 10:08
Test sublime gist plugin
layout title date comments categories
post
Test Post
2013-04-26 22:12
true

Testing code blocks:

---
layout: post
title: "Test Post"
date: 2013-04-26 22:12
comments: true
categories:
---
Testing code blocks:
@utx0
utx0 / gist:5559690
Created May 11, 2013 11:20
haml_newline_issues
%h1 Archive for
-case page_type
-when 'day'
~ Date.new(year, month, day).strftime('%b %e %Y')
-when 'month'
~ Date.new(year, month, 1).strftime('%b %Y')
-when 'year'
~ year
# GET /products/new
def new
@product = current_user.products.build
#binding.pry
@product.product_countries.build
@product.people.build
end
@utx0
utx0 / product.rb
Created May 29, 2013 06:57
model_in_question
class Product < ActiveRecord::Base
include ActionView::Helpers
MASS_ASSIGNABLE_ATTRIBUTES = [:authority, :category_id, :category_ids, :country_id, :description, :duration,
:long_description, :name, :people_attributes, :permission, :poster, :poster_cache, :product_countries_attributes,
:product_id, :product_people_attributes, :region_ids, :user_attributes, :year_of_completion, :terms_and_conditions]
attr_accessible *MASS_ASSIGNABLE_ATTRIBUTES
attr_accessible *MASS_ASSIGNABLE_ATTRIBUTES, as: :admin
attr_accessible :assets_attributes, :cash_value, :product_type, :recommended, :status, :tags_autocomplete, :user_id,
as: :admin

Keybase proof

I hereby claim:

  • I am lukekhamilton on github.
  • I am lukekhamilton (https://keybase.io/lukekhamilton) on keybase.
  • I have a public key ASAcgUpCxYU3J_rJW5OeH3TxWqn8UdfM0LtOcJZPKmss1go

To claim this, I am signing this object:

Verifying that "lukekhamilton.id" is my Blockstack ID. https://explorer.blockstack.org/name/lukekhamilton.id