Skip to content

Instantly share code, notes, and snippets.

View fmquaglia's full-sized avatar
🎯
Focusing

Fabricio Quagliariello fmquaglia

🎯
Focusing
  • Ciudad Autónoma de Buenos Aires, Argentina
View GitHub Profile
@fmquaglia
fmquaglia / release_notes.md
Last active May 19, 2020 10:06
Release Notes

Release Notes Guide and Template

This guide provides an outline, writing style guidelines, and a document template to help you structure and write your release notes.

It is not a set of rules.

After you fork this document or copy the example template found below, feel free to remove or modify sections and syntax that aren't applicable to the release.

@fmquaglia
fmquaglia / 01_requirements.md
Last active January 3, 2019 04:13
Andrew Exercise

REQUIREMENTS

You need to design a programming module PERMISSIONS that would allow Caller to Grant a permission to a User.
Check if a User has a particular Permission.

Caller is an external system that uses our module (particularly it calls our API).

Permission is a user right to take an action or access a resource.
Permissions for resource access can be READ or WRITE.
For example, Caller can grant a permission ”reboot the server” (an example of action) OR write to a file “C:/readme.txt” (an example of resource) to a user Andrew.

@fmquaglia
fmquaglia / example.js
Created June 29, 2017 17:43
CleverTap integration with a Chrome extension
console.log("Extension is active");
var elt = document.createElement("script");
elt.innerHTML = "window.clevertap = {event:[], profile:[], account:[], notifications:[], onUserLogin:[]};window.clevertap.account.push({'id': '846-Z7Z-6K4Z'})";
document.head.appendChild(elt);
(function () {
var wzrk = document.createElement('script');
wzrk.type = 'text/javascript';
wzrk.async = true;
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
'use strict';
angular.module('circleBackApp').controller(
'UICtrl',
function($scope,
$analytics,
$filter,
$location,
$log,
$q,
'use strict';
angular.module('circleBackApp')
.controller('ContactsCtrl',
function($scope,
$routeParams,
$route,
$rootScope,
$location,
$timeout,
'use strict';
angular.module('circleBackApp')
.service('Contacts', function($rootScope, $http, $localStorage, $log, $q, $filter, $timeout, CBCore, AuthService, Sorting, Groups) {
var Contacts = {};
Contacts.byId = {}; // contactId: Contact
Contacts.byGroupId = {}; // groupId: {contactId: Contact} LIVE contacts only
Contacts.groupsByContactId = {}; // contactId: {id: group}
Contacts.trashById = {}; // contactId: Contact
@fmquaglia
fmquaglia / README.md
Last active December 11, 2015 21:21
question to Ravi

Passing parameters to an email script token

Is there a way to "pass a parameter" to an email script token?

We would like to pass a string to an email script from the email definition, in the same way the user defines a default value for the token, and thus be able to use that string in the velocity script.

Let's say we have an email script token called my.foo

This hypotetical token is meant to be used in the email by passing a "parameter" (let's suppose we call this parameter bar)

// kills long running ops in MongoDB (taking seconds as an arg to define "long")
// attempts to be a bit safer than killing all by excluding replication related operations
// and only targeting queries as opposed to commands etc.
killLongRunningOps = function(maxSecsRunning) {
currOp = db.currentOp();
for (oper in currOp.inprog) {
op = currOp.inprog[oper-0];
if (op.secs_running > maxSecsRunning && op.op == "query" && !op.ns.startsWith("local")) {
print("Killing opId: " + op.opid
@fmquaglia
fmquaglia / main.rb
Created October 6, 2015 06:16
promising-future example with ost
# See https://github.com/bhuga/promising-future
require "ost"
require "future"
Ost.redis.call('FLUSHDB')
300.times do |i|
Ost[:foo] << i
end