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
/**
* An array of countries with ISO2 codes as key
*
* @return array
**/
function getCountries()
{
$options["AF"] = "Afghanistan";
class Foo
@foo = {
'test' => {'test2' => 'test3'},
'test4' => {'test5' => 'test6'},
}
def self.foo?
@foo
end
#!/usr/bin/env bash
#tmux new-session -d -s rails 'title rails-development; stty -ixon; vim'
cd ~/develop/projs/html5-audio-player-typescript
title oswp
tmux new-session -d -s oswp
# For some reason, send-keys does nothing here, not even an error is displayed.
@rodolfobandeira
rodolfobandeira / README.md
Created September 15, 2016 15:51 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
#!/usr/bin/env ruby
require 'aws-sdk'
sts = Aws::STS::Client.new(
region: 'us-east-1',
access_key_id: "<insert access key id>",
secret_access_key: "<secret>"
)
@rodolfobandeira
rodolfobandeira / README.md
Created November 9, 2016 21:23 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :