Skip to content

Instantly share code, notes, and snippets.

View adamkirkwood's full-sized avatar
🏠
Working from home

Adam Kirkwood adamkirkwood

🏠
Working from home
View GitHub Profile
@adamkirkwood
adamkirkwood / api-v1-plugins.json
Last active March 30, 2016 00:44
[GET] /api/v1/plugins
[
{
"name": "sync.sketchplugin",
"description": "Use Google Sheets to sync typography across your team.",
"author": "Stan",
"owner": "nolastan"
},
{
"name": "qordoba-for-sketch",
"description": "Qordoba’s Sketch plugin allows designers to translate their mockups to other languages, making product internationalization easier.",
@adamkirkwood
adamkirkwood / routes.rb
Created March 19, 2016 19:50
Sketchpacks.com OpenSearch implementation
Rails.application.routes.draw do
# ...snip...
resources :plugins, concerns: :paginatable, path_names: { new: 'register' } do
get '/search', to: 'plugins#search', on: :collection, as: 'search'
end
# ...snip...
end
@adamkirkwood
adamkirkwood / plugins_controller.rb
Created March 19, 2016 19:49
Sketchpacks.com OpenSearch implementation
class PluginsController < ApplicationController
# ...snip...
def search
redirect_to plugins_path if search_query.blank?
@plugins = Plugin.search(search_query).page params[:page]
# redirect to plugin if the search returned a direct hit
@adamkirkwood
adamkirkwood / opensearch.xml
Created March 19, 2016 19:48
Sketchpacks.com - OpenSearch definition
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<OutputEncoding>UTF-8</OutputEncoding>
<InputEncoding>UTF-8</InputEncoding>
<AdultContent>false</AdultContent>
<Language>en-us</Language>
<ShortName>Sketchpacks</ShortName>
<LongName>Google Search of Sketchpacks.com</LongName>
<Description>Use Google to search Sketchpacks, the Sketch Community's plugin registry and directory</Description>
@adamkirkwood
adamkirkwood / opensearch.xml
Created March 19, 2016 19:46
Sketchpack.com's OpenSearch implementation
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<OutputEncoding>UTF-8</OutputEncoding>
<InputEncoding>UTF-8</InputEncoding>
<AdultContent>false</AdultContent>
<Language>en-us</Language>
<ShortName>Sketchpacks</ShortName>
<LongName>Google Search of Sketchpacks.com</LongName>
<Description>Use Google to search Sketchpacks, the Sketch Community's plugin registry and directory</Description>
<Tags>sketchapp sketch plugins registry directory search</Tags>
# Attach the scope as part of a chain in an ActiveRecord query:
UserFacebookFanpages.valid.tracked.find(:all)
@adamkirkwood
adamkirkwood / gist:1767824
Created February 8, 2012 10:16 — forked from ismasan/gist:1582736
Linode Ubuntu 10.04 (Lucid) with passenger & nginx for rails hosting
#################################################################
# #
# A guide to setting up a linode Ubuntu VPS for #
# Ruby on Rails hosting with nginx & passenger #
# #
# Compiled by Chris Toomey [ctoomey.com] on Sept. 9 2011 #
# #
#################################################################
# Start with base 10.04 image. Setup the DNS for any domains you
MOCHIGAMES.namespace(MOCHIGAMES, 'GameRating');
MOCHIGAMES.GameRating = (function(parent, $) {
var Settings = {
base: window.location.origin,
endpoint: 'api/v1/usergamerating'
};
var Game = {
DatabaseError at /
column profiles_userprofile.date_to_double_purchase_limit does not exist
LINE 1: ...s", "profiles_userprofile"."is_banned_from_chat", "profiles_...
^
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.3 SVN-67268
Exception Type: DatabaseError
Exception Value:
column profiles_userprofile.date_to_double_purchase_limit does not exist
<div class="offer-item">
<input type="radio" name="offerURL" class="radio" value="https://buy.boku.com/checkoutidentify/b6e52d180c115a1e28fc4cab/buy.js" />
<label><span class="item-amount">21,592</span> <span class="currency-name">MOCHICOINS</span> for $<span class="item-price">26.99</span></label>
</div>