Skip to content

Instantly share code, notes, and snippets.

Avatar

Georg Leciejewski schorsch

View GitHub Profile
@schorsch
schorsch / SalesKing-oAuth-PHP-Example.php
Last active Sep 25, 2015
Minimal example of how to authenticate a SalesKing app
View SalesKing-oAuth-PHP-Example.php
<?php
$app_id = "APP_CLIENT_ID";
$app_secret = "APP_SECRET";
$app_url = "http://localhost/oauth_test";
$app_scope = "api/clients:read";
$sk_url = "https://SUBDOMAIN.salesking.eu";
$code = $_REQUEST["code"];
if(empty($code)) { # redirect to authorize url
@schorsch
schorsch / gist:134652
Created Jun 23, 2009
Rails Form helper to ease the rendering of nested_forms via accepts_nested_attributes_for
View gist:134652
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.
View gettext_haml_parser.rb
# From http://blog.teamschnitzel.com/2007/05/14/haml-parsing-for-ruby-gettext
require 'gettext/tools/rgettext'
module HamlParser
module_function
def target?(file)
File.extname(file) == ".haml"
end
You can’t perform that action at this time.