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
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@fmquaglia
fmquaglia / aifqF.markdown
Created September 6, 2014 02:33
A Pen by Fabricio Quagliariello.
AL: 'Alabama',
AK: 'Alaska',
AZ: 'Arizona',
AR: 'Arkansas',
CA: 'California',
CO: 'Colorado',
CT: 'Connecticut',
DE: 'Delaware',
FL: 'Florida',
GA: 'Georgia',
def log(message, level= :info, banner= false)
BH.logger.send level, '-'*80 if banner
BH.logger.send level, message
BH.logger.send level, '-'*80 if banner
end
class CredentialsController < ApplicationController
def authorize_credentials
redirect_to new_polymorphic_path([current_user, credential_type.new], request.query_parameters)
end
private
def credential_type
Credentials::SalesforceInstanceCredential
@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
@fmquaglia
fmquaglia / Main.java
Created December 11, 2012 12:35
Ejemplo de cómo usar Regex para encontrar los últimos dígitos en un string
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* User: fabricio
* Date: 12/11/12
* Time: 9:22 AM
*/
public class Main {
public static void main(String[] args) {
// 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 / 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)

@fmquaglia
fmquaglia / .bashrc
Created April 16, 2013 16:23
This is a list of steps to get postgres installed and plugged with rails
### Aliases for postgres
pg_function() {
pg_ctl -D /usr/local/var/postgres -l logfile "$@" ;
}
alias pg="pg_function" # so now you may start and stop postgres using pg start or pg stop