Skip to content

Instantly share code, notes, and snippets.

View ArnauAregall's full-sized avatar

Arnau Aregall ArnauAregall

View GitHub Profile
@ArnauAregall
ArnauAregall / inbox.js
Created January 22, 2016 23:54
Node 4.0.x IMAP inbox reader example
'use strict';
// npm install inbox -save
// npm install stream -save
var inbox = require('inbox'),
Stream = require('stream');
var client = inbox.createConnection(false, 'mail.bar.es', {
secureConnection: true,
@ArnauAregall
ArnauAregall / app.js
Created March 15, 2014 09:00
AngularJS - Minifying application module with $interpolateProvider setting.
(function(){}(
/*
* Define an application module which needs external directives (someDirectives.js).
* The application should set the $interpolateProvider start and end syntax, like : #{foo.bar}
* It will need to be minified later.
*/
var app = angular.module('myApp', ['someDirectives'],
['$interpolateProvider', function($interpolateProvider) {
$interpolateProvider.startSymbol('#{');
var express = require('express'),
consolidate = require('consolidate');
var app = express();
app.engine("html", consolidate.swig); // setup template engine Swig
app.set('view engine', 'html'); // the Swig engine will render HTML
app.set('views', __dirname); // and the HTML views are in this folder
/*
/*
* Android API Guide
* http://developer.android.com/guide/topics/ui/actionbar.html
* Android Design Guide
* http://developer.android.com/design/patterns/actionbar.html
* Titanium Mobile will support someday
* https://jira.appcelerator.org/browse/TIMOB-2371
*/
var osName = Ti.Platform.osname,
isAndroid = osName==='android',
@ArnauAregall
ArnauAregall / Watermarker.php
Last active December 13, 2015 20:39
PHP Watermarker Class Adapted for Yii Framework
<?php
/**
* This is a driver for the watermarks creating
*
* LICENSE:
* The PHP License, version 3.0
*
* Copyright (c) 1997-2005 The PHP Group
*