A Pen by Fabricio Quagliariello on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AL: 'Alabama', | |
AK: 'Alaska', | |
AZ: 'Arizona', | |
AR: 'Arkansas', | |
CA: 'California', | |
CO: 'Colorado', | |
CT: 'Connecticut', | |
DE: 'Delaware', | |
FL: 'Florida', | |
GA: 'Georgia', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://github.com/bhuga/promising-future | |
require "ost" | |
require "future" | |
Ost.redis.call('FLUSHDB') | |
300.times do |i| | |
Ost[:foo] << i | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
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
)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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 |
OlderNewer