Skip to content

Instantly share code, notes, and snippets.

View rafaelcalleja's full-sized avatar

Rafael Calleja rafaelcalleja

View GitHub Profile
/*
Change proposed values as necessary...
Proposed Table Name: `region`
Proposed Columns: ID(primary,), Name(char64), CountryCode(char2)
ID - varchar(6), primary key, not null
Name - varchar(64), not null
Country - char(2), not null
*/
INSERT INTO `region` VALUES
('AD-02', 'Canillo', 'AD'),
@rafaelcalleja
rafaelcalleja / README.md
Created March 17, 2016 00:03 — 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 :

@rafaelcalleja
rafaelcalleja / DirectoryStructure
Created June 3, 2016 09:53 — forked from satooshi/DirectoryStructure
Directory structure of Domain Driven Design application with Symfony2, Doctrine2.
sf2-ddd
├── app
├── bin
├── build
├── lib
├── src
│   └── __VendorPrefix
│   ├── Application
│   │   └── __DomainNameBundle
│   │   ├── Command
@rafaelcalleja
rafaelcalleja / snippet.js
Created September 16, 2016 10:07 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
(function () {
while (img = document.evaluate('//img[contains(@src, \'googleusercontent.com\')]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue) {
var src = img.attributes.src.value;
src = src.substr(src.indexOf('#') + 1);
img.attributes.src.value = src;
}
})();
@rafaelcalleja
rafaelcalleja / ddd_cqrs_event-sourcing_in_php.md
Created April 19, 2017 06:45 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@rafaelcalleja
rafaelcalleja / vm-resize-hard-disk.md
Created May 8, 2017 09:04 — forked from miraleung/vm-resize-hard-disk.md
Resize a hard disk for a vagrant-provisioned, VirtualBox-provided virtual machine using gparted and fdisk.

Added gparted instructions to extend the virtual disk to fork from christopher-hopper/vm-resize-hard-disk.md.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

@rafaelcalleja
rafaelcalleja / gist:663ebfddd156bc7d32375ddce1635c32
Created August 7, 2017 11:55 — forked from ondrasak/gist:10266716
Internet Explorer for Mac the Easy Way: Run IE 7, IE8, & IE9 in a Virtual Machine
1) If you have instaled VirtualBox skip this step. Download and install VirtualBox – Download Now (direct .dmg download link) – visit VirtualBox Downloads page
2) Launch the Terminal (located in /Applications/Utilities/)
3) Decide which versions of Internet Explorer you want to download and install. Select the text below and copy it:
- Install ALL versions of Internet Explorer: IE7, IE 8, and IE 9
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash
- Install Internet Explorer 7 Only
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="7" bash
@rafaelcalleja
rafaelcalleja / gist:8167484332fda0105f46ca55ac539043
Created December 15, 2017 08:53 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@rafaelcalleja
rafaelcalleja / _readme.md
Created August 3, 2018 15:14 — forked from vhenzl/_readme.md
Awesome whatever (PHP, DDD, CQRS, events & messaging, Doctrine, REST & APIs, PHPStorm,... links)

Awesome whatever

Collection of various links – blogs, articles, libraries/frameworks & repos, etc. Not necessarily really awesome.

Content