Skip to content

Instantly share code, notes, and snippets.

View qmacro's full-sized avatar

DJ Adams qmacro

View GitHub Profile
method IF_HTTP_EXTENSION~HANDLE_REQUEST.
handler( p = '^/$' h = 'Y_COF_H_MAINPAGE' ).
handler( p = '^/channel/submissionform$' h = 'Y_COF_H_CHANSUBMITFORM' ).
handler( p = '^/channel/([^/]+)/subscriber/submissionform$' h = 'Y_COF_H_CHNSUBSUBMITFORM' ).
handler( p = '^/channel/([^/]+)/subscriber/$' h = 'Y_COF_H_CHNSUBCNT' ).
handler( p = '^/channel/([^/]+)/subscriber/([^/]+)/$' h = 'Y_COF_H_CHNSUB' ).
dispatch( server ).
method DERIVE_HANDLER.
* Loops through the patterns trying to find a match on the URL's path info
* If it finds one, it returns the corresponding handler class name, plus
* an optional list of matched strings from parentheses in the pattern
data:
l_path type char255
, ls_handler type ty_handler
, lt_match type match_result_tab
method DISPATCH.
data:
l_script type string
, lt_meth_parm type abap_parmbind_tab
, lt_resp_parm type abap_parmbind_tab
, lt_meth_excp type abap_excpbind_tab
, ls_parm type abap_parmbind
, lo_excp type ref to cx_sy_dyn_call_error
, l_excptext type string
@qmacro
qmacro / inserttask.py
Created May 15, 2011 13:54
Sample Task insert using Google API Client library for Python
# Insert a new task into the user's default task list
# Based upon the sample urlshortener.py code for the
# Google API Python Client library
# http://code.google.com/p/google-api-python-client/source/browse/samples/urlshortener/urlshortener.py
# Note that the response to the task insert is a 200, rather than a 201
# If you want to run this, get your own client_id and client_secret using the
# Google API Console https://code.google.com/apis/console/
@qmacro
qmacro / ODataTable.html
Created February 13, 2012 21:12
SAPUI5 says "Hello OData" to NetWeaver Gateway
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>SAP OData in SAPUI5 Data Table Control</title>
<!-- Load SAPUI5, select theme and control library -->
<script id="sap-ui-bootstrap"
type="text/javascript"
src="http://gateway.server:port/sapui5/sapui5-static/resources/sap-ui-core.js"
data-sap-ui-theme="sap_platinum"
@qmacro
qmacro / basecamp_todos.coffee
Created February 23, 2012 22:47
Hubot script: Basecamp Todos
# Basecamp todos
# Reports a count of the person's outstanding todo items per todo list.
# Uses bcapi.coffee (coming soon!)
# (Don't forget to set the HUBOT_BASECAMP_KEY and HUBOT_BASECAMP_URL)
bcapi = require '../src/bcapi'
module.exports = (robot) ->
robot.hear /my todo(s| item)?/i, (msg) ->
basecamp_users msg, (people) ->
@qmacro
qmacro / gist:2589735
Created May 3, 2012 21:42
Revealing the embedded jQuery 1.6.2 in an SAP NetWeaver Gateway system (2.0 SP03)
class ZCL_DJ0 definition
public
inheriting from /IWCOR/CL_DS_HDLR_DEBUG
final
create public .
public section.
class-methods RUN .
protected section.
@qmacro
qmacro / yrequestbin
Created May 17, 2012 15:17
ABAP wrapper for http://requestb.in in a 'release early release often' stylee
class YREQUESTBIN definition
public
final
create public .
public section.
*"* public components of class YREQUESTBIN
*"* do not include other source files here!!!
data NAME type STRING .
@qmacro
qmacro / conditionaldatabinding.html
Created May 25, 2012 13:26
SAPUI5 Conditional Databinding
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>SAPUI5 Conditional Databinding</title>
<script src="resources/sap-ui-core.js"
type="text/javascript"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons,sap.ui.table"
data-sap-ui-theme="sap_goldreflection">
</script>
@qmacro
qmacro / gist:3999375
Created November 2, 2012 08:00
GoogleAppsScript ROT functions
var alphabet = 'abcdefghijklmnopqrstuvwxyz';
function rotText(text, n) {
var newText = "";
for (var i = 0, j = text.length; i < j; i++) {
newText += rot(text[i], n);
}
return newText;
}