Skip to content

Instantly share code, notes, and snippets.

@goldenboy
goldenboy / routes.py
Created February 10, 2012 15:03 — forked from gilsondev/routes.py
Exemplo usado na vídeo aula de rotas
#!/usr/bin/python
# -*- coding: utf-8 -*-
# default_application, default_controller, default_function
# are used when the respective element is missing from the
# (possibly rewritten) incoming URL
#
default_application = 'clientes' # ordinarily set in base routes.py
default_controller = 'clientes' # ordinarily set in app-specific routes.py
default_function = 'novo' # ordinarily set in app-specific routes.py
@goldenboy
goldenboy / pyminifier.py
Created February 14, 2012 11:09
Python Minifier:** Reduces the size of (minifies) Python code for use on embedded platforms.
## {{{ http://code.activestate.com/recipes/576704/ (r16)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyminifier.py
#
# Copyright 2009 Dan McDougall <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
var f,proxy,d=document;
var addCss = function(s) {
var c = d.createElement('style');
c.type = 'text/css';
if (c.styleSheet)
c.styleSheet.cssText = s;
else
c.appendChild(d.createTextNode(s));
d.getElementsByTagName('HEAD')[0].appendChild(c);
var TinyORM = (function(options) {
/* a hash containing all the available models */
var Models = {};
var connection = null;
var config = _.extend({
/* The name of the database which Ti will open. The local db is located at:
~/Library/Application Support/iPhone Simulator/4.2/Applications/APP_ID/Library/Application Support/database/dbname
*/
dbname: 'add.db',
var TinyORM = (function(options) {
/* a hash containing all the available models */
var Models = {};
var connection = null;
var config = _.extend({
/* The name of the database which Ti will open. The local db is located at:
~/Library/Application Support/iPhone Simulator/4.2/Applications/APP_ID/Library/Application Support/database/dbname
*/
dbname: 'add.db',
page_id = 102329749861
params = {
:v => '1.0',
:api_key => FACEBOOKER["api_key"],
:method => 'stream.get',
:format => 'XML',
:source_ids => page_id,
:session_key => 'bd7156a08fefbd368b54d2da-54500509',
:limit => 2
Marrily's data can be accessed via a RESTful interface. Here are the documentation on how to access the API. Currently the data are represented via JSON format only.
1. v1 API info
===============
The current API is at v1, and the all API access is over HTTP, starting with
http://api.marrily.com/api/v1/
If the subscription is expired, you will get a 402 error for non-GET requests (except for user's authentication).
@goldenboy
goldenboy / util.js
Created February 16, 2012 14:24 — forked from sr3d/util.js
/* Wrapper on top of the HTTP client */
function Request(url, options) {
if( !url ) { throw "Invalid URL"; };
options = _.extend({
method: 'GET',
async: true,
evalJSON: true,
parameters: {},
headers: [], // [ [key, value], [key, value] ]
onSuccess: function(){},
$ openssl req -new -key private.key -out marrily.com.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
openssl genrsa -out private.key 2048
Generating RSA private key, 2048 bit long modulus
..............................+++
.+++
e is 65537 (0x10001)