Skip to content

Instantly share code, notes, and snippets.

View rodolfobandeira's full-sized avatar

Rodolfo rodolfobandeira

View GitHub Profile
#!/usr/bin/env python
import sys
from datetime import datetime
import subprocess
DB_LOGIN = 'root'
DB_PASSWD = 'XXXX'
VAULT_NAME = 'backup_sunny'
HOSTNAME = 'Sunny'
#!/bin/bash
# include config
# config example below:
#
#
# Example deploy_config.sh
#
# dev_env() {
<?php
// file: ./Shape/Circle.php
namespace Shape;
class Circle extends Shape implements ShapeInterface {
public function __construct() {
var_dump($this);
}
<?php
/**
* Diglin GmbH - Switzerland
*
* User: sylvainraye
* Date: 22.03.14
* Time: 17:11
*
* @category orocrm
* @package Diglin_Oro
<?php
echo (int) bcmul(bcadd('0.1', '0.7', '2'), '10', '2');
<?php
/**
* An array of countries with ISO2 codes as key
*
* @return array
**/
function getCountries()
{
$options["AF"] = "Afghanistan";
AF: Afghanistan
AX: 'Åland Islands'
AL: Albania
DZ: Algeria
AS: 'American Samoa'
AD: Andorra
AO: Angola
AI: Anguilla
AQ: Antarctica
AG: 'Antigua and Barbuda'
@rodolfobandeira
rodolfobandeira / gist:49838e7a1f36a3c3b437
Created April 22, 2015 14:53
Export Amazon RDS mysql into a file or another database
mysqldump -h RDS instance endpoint -u user -p password --port=3306 --single-transaction --routines --triggers --databases database database2 > path/rds-dump.sql
mysqldump -h RDS instance endpoint -u user -p password --port=3306 --single-transaction --routines --triggers --databases database database2 --compress --compact | mysql -h MySQL host -u master user -p password --port 3306
@rodolfobandeira
rodolfobandeira / prediction-first-event.php
Created April 22, 2015 18:18
Create a first event using Prediction.io
<?php
require_once("vendor/autoload.php");
use predictionio\EventClient;
$accessKey = 'YOUR_ACCESS_KEY';
$client = new EventClient($accessKey);
$response = $client->createEvent(array(
'event' => 'my_event',
'entityType' => 'user',
@rodolfobandeira
rodolfobandeira / datagrid.yml
Created April 23, 2015 19:07
Add owner filter on Leads/Opportunities datagrids - OroCRM
datagrid:
custom-sales-opportunity-grid:
extended_entity_name: %orocrm_sales.opportunity.class%
options:
entityHint: opportunities
export: true
entity_pagination: true
source:
type: orm
acl_resource: orocrm_sales_opportunity_view