Skip to content

Instantly share code, notes, and snippets.

View schorsch's full-sized avatar

Georg Leciejewski schorsch

View GitHub Profile
schorsch / SalesKing-oAuth-PHP-Example.php
Last active September 25, 2015 01:47
Minimal example of how to authenticate a SalesKing app
$app_id = "APP_CLIENT_ID";
$app_secret = "APP_SECRET";
$app_url = "http://localhost/oauth_test";
$app_scope = "api/clients:read";
$sk_url = "";
$code = $_REQUEST["code"];
if(empty($code)) { # redirect to authorize url
schorsch / gist:134652
Created June 23, 2009 16:24
Rails Form helper to ease the rendering of nested_forms via accepts_nested_attributes_for
module KingForm
# Method for building forms that contain fields for associated models.
module NestedFormHelper
# Renders the form for nested objects defined via activerecord accepts_nested_attributes_for
# The associated argument can be either an object, or a collection of objects to be rendered.
# An options hash can be specified to override the default behaviors.
# From
require 'gettext/tools/rgettext'
module HamlParser
def target?(file)
File.extname(file) == ".haml"