Skip to content

Instantly share code, notes, and snippets.

View elaatifi's full-sized avatar
💭
I may be slow to respond.

Sidi Mohamed ELAATIFI elaatifi

💭
I may be slow to respond.
View GitHub Profile
@colemanw
colemanw / font-awesome-mime-type-icons.php
Last active March 11, 2024 04:21 — forked from guedressel/font-awesome-mime-type-icons.php
Font Awesome File Icons: Mapping MIME Types to correct icon classes
<?php
/**
* Get font awesome file icon class for specific MIME Type
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551
*
*/
function ($mime_type) {
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
$icon_classes = array(
@acolyer
acolyer / service-checklist.md
Last active June 20, 2024 08:47
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@elaatifi
elaatifi / AnnotationClassMapBuilder.java
Created March 21, 2013 10:36
Example of a class-map builder supporting custom annotations to configure Orika mapper.
/*
AnnotationClassMapBuilder extends the default class map builder and override byDefault method to lookup for more metadata
*/
public class AnnotationClassMapBuilder<A, B> extends ClassMapBuilder<A, B> {
protected AnnotationClassMapBuilder(Type<A> aType, Type<B> bType, PropertyResolverStrategy propertyResolver,
DefaultFieldMapper[] defaults) {
super(aType, bType, propertyResolver, defaults);
}
@nikolaplejic
nikolaplejic / core.clj
Created September 2, 2010 17:54
File upload example in Compojure
(ns fileupload.core
(:use [net.cgrand.enlive-html
:only [deftemplate defsnippet content clone-for
nth-of-type first-child do-> set-attr sniptest at emit*]]
[compojure.core]
[ring.adapter.jetty])
(:require (compojure [route :as route])
(ring.util [response :as response])
(ring.middleware [multipart-params :as mp])
(clojure.contrib [duck-streams :as ds]))