Skip to content

Instantly share code, notes, and snippets.

View catacs's full-sized avatar

Catalin Stanciu catacs

View GitHub Profile
@catacs
catacs / call_with_curl.md
Last active May 22, 2019 15:33
Asterisk ARI
@catacs
catacs / main.lua
Created August 16, 2018 14:08
Example Firebase Analytics setCurrentScreen
local firebaseAnalytics = require "plugin.firebaseAnalytics"
firebaseAnalytics.init()
local widget = require("widget")
local bg = display.newRect( display.contentCenterX, display.contentCenterY, display.actualContentWidth, display.actualContentHeight )
bg:setFillColor( 1,.5,0 )
local title = display.newText( {text = "Firebase Analytics", fontSize = 30} )
title.width, title.height = 300, 168
title.x, title.y = display.contentCenterX, 168*.5
@catacs
catacs / body-parameters-node.js
Last active April 22, 2017 19:34
How to get body parameters in node.js
const bodyParser = require('body-parser');
const express = require('express');
const app = express();
const multer = require('multer');
const upload = multer();
app.use(bodyParser.json());
var router = express.Router();
@catacs
catacs / mongo-c-driver.md
Last active March 8, 2016 21:16
MongoDB driver for C

Centos 6.7

export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/src/mongo-c-driver-1.3.3/src/:/usr/local/lib/pkgconfig/

@catacs
catacs / singleton.js
Created February 15, 2016 15:40
Singleton pattern javascript
var Singleton = (function () {
var privateVariable = 'value';
function privateFunction() {
}
function publicFunction() {
}
return {
@catacs
catacs / factory.js
Created February 15, 2016 15:38
Factory pattern javascript
// Constructor
var Class = function(value1, value2) { }
// Factory
Class.factory(value1) {
return new Class(value1, 'aaa');
};
// properties and methods
Class.prototype = { ... };
@catacs
catacs / class.js
Created February 15, 2016 15:38
Class pattern javascipt
// Constructor
var Class = function (value1, value2) {
this.value1 = value1;
};
// properties and methods
Class.prototype = {
value1: 'default_value',
method: function (argument) {
this.value2 = argument + 100;