Skip to content

Instantly share code, notes, and snippets.

View liuggio's full-sized avatar

Giulio De Donato liuggio

  • Radical Company
  • London
View GitHub Profile
@proudlygeek
proudlygeek / TestDecamelize.php
Created February 22, 2012 22:49
decamelize
<?php
require_once 'decamelize.php';
class TestDecamelize extends PHPUnit_Framework_TestCase
{
public function testOneCamel()
{
$rs = decamelize("camelCase");
$this->assertEquals($rs[0], "camel");
@hjr3
hjr3 / e-commerce.md
Created April 3, 2012 05:35
Examples of RESTful API calls for E-commerce platforms

Examples of RESTful API calls for E-commerce platforms

These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.

Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.

Relevant links

@proudlygeek
proudlygeek / roman.rb
Created June 26, 2012 22:43
Roman Numbers
def romanize(n)
number_map = [
["M", 1000],
["CM", 900],
["D", 500],
["CD", 400],
["C", 100],
["XC", 90],
["L", 50],
["XL", 40],
@bhang
bhang / supervisord_graphite_statsd.conf
Created June 27, 2012 13:45
Graphite + statsd supervisord configuration
[program:gunicorn-graphite]
command=/usr/local/bin/gunicorn_django -u www-data -g www-data -b 127.0.0.1:8080 --log-file=/opt/graphite/storage/log/webapp/gunicorn.log /opt/graphite/webapp/graphite/settings.py
process_name=%(program_name)s
autostart=true
autorestart=true
stopsignal=QUIT
user=www-data
[program:carbon-cache]
command=python /opt/graphite/bin/carbon-cache.py --debug start
#Stop mysql service
service mysql stop
# Crate your ramdisk partition
mkdir /mnt/myramdisk
mount -t tmpfs -o size=150M tmpfs /mnt/myramdisk
# Set the correct permissions
chown mysql /mnt/myramdisk
chgrp mysql /mnt/myramdisk
@SzymonPobiega
SzymonPobiega / gist:5220595
Last active April 25, 2024 17:19
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
@klein0r
klein0r / gist:5441524
Last active July 23, 2021 15:20 — forked from davidalexander/gist:1086455
Magento Tips, Tricks and Snippets
@pborreli
pborreli / Instruction.md
Last active December 19, 2015 09:29
How to retrieve your GitHub Pull Request count using Google bigquery

Go to Google bigquery and execute the following query replacing XXX with your GitHub login

@toretto460
toretto460 / SML_examples.sml
Last active December 27, 2015 04:39
Standard ML Examples
(* Type checker *)
fun fReal (x) = x + 0.0;
fun fInteger (x) = x + 0;
(*
if true then fReal(3.0) else fInteger(3);
Error: types of if branches do not agree !!
*)
(* call by value *)
fun myif a b c = if a then b else c;
@giorrrgio
giorrrgio / xdphp.sh
Last active August 29, 2015 14:06
xdphp.sh
#!/bin/bash
php -dxdebug.remote_autostart=On -didekey=PHPSTORM -dremote_host=localhost $*