Skip to content

Instantly share code, notes, and snippets.

View housni's full-sized avatar

Housni Yakoob housni

View GitHub Profile
/**
* Assembles query parameters.
*
* @param {array} queries The query string component from the request.
* @return {string} The query string joined using `&`.
*/
module.exports.assembleQuery = function (queries) {
var query = [];
for (var property in queries) {
query.push(property + "=" + queries[property]);
@housni
housni / get.js
Created September 27, 2018 15:38
'use strict';
var helper = require('./lib/helper');
/**
* Handles GET requests.
*/
module.exports.handler = (event, context, callback) => {
// Prevent crashing due to uncallable callbacks.
// See: http://justbuildsomething.com/node-js-best-practices/#5
callback = (typeof callback === 'function') ? callback : function() {};
var query = helper.assembleQuery(event.queryStringParameters);
---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
GetFunction:
Type: AWS::Serverless::Function
Properties:
Description: "Handles GET requests."
Handler: get.handler
Runtime: nodejs6.10
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
MyLambdaFunction:
Type: AWS::Lambda::Function
.
.
.
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyLambdaFunction:
Type: AWS::Lambda::Function
.
.
.
version: '2'
services:
mariadb:
env_file:
- ./mariadb/dev/passwords.env
# cat ./mariadb/dev/passwords.env
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=database_name_here
# sudo apt-get install make build-essential ccache g++ libgif-dev libjpeg62-dev libfreetype6-dev libpng12-dev libgif-dev
# cd /tmp/alfrescoinstall
# curl -# -O http://www.swftools.org/swftools-2013-04-09-1007.tar.gz
# tar xf swftools*.tar.gz
# cd "$(find . -type d -name "swftools*")"
# ./configure
# sudo make && sudo make install
Installing build tools and libraries needed to compile swftools. Fetching packages...
debconf: unable to initialize frontend: Dialog
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c
Model:
<?php
class ZipCodes extends \app\extensions\data\Model {
protected $_meta = array(
'key' => 'zip_code_id',
'title' => 'state_name'
);
protected $_schema = array(
<?php
//extensions/data/Model.php
public static function __init() {
static::_isBase(__CLASS__, true);
parent::__init();
//static::all(); //doesn't work
#$self = static::_object();