Skip to content

Instantly share code, notes, and snippets.

View aitoroses's full-sized avatar

Aitor Oses aitoroses

View GitHub Profile
@aitoroses
aitoroses / gulp_multi_src
Created September 29, 2014 09:07
gulp multi src streams coffee/js
es = require("event-stream")
es.concat(
gulp.src('*.coffee')
.pipe(coffee()),
gulp.src('*.js')
).pipe(concat('all.js'))
.pipe(gulp.dest('.'))
/**
*
* MOVED TO: https://github.com/iFind/html5MultidimensionalStorage
*
* This methods extends the default HTML5 Storage object and add support
* to set and get multidimensional data
*
* @example Storage.setObj('users.albums.sexPistols',"blah");
* @example Storage.setObj('users.albums.sexPistols',{ sid : "My Way", nancy : "Bitch" });
* @example Storage.setObj('users.albums.sexPistols.sid',"Other songs");
@aitoroses
aitoroses / JerseyFileDownload.md
Last active August 29, 2015 14:19
JERSEY: File download example code
@GET
@Path("/attachments/{attachmentId}/{version}")
public Response downloadAttachment(@PathParam("attachmentId") Long attachmentId, @PathParam("version") Long version) {
  
  Attachment attachment = AttachmentAPI.get(attachmentId, version);
  
  // Extract the content and the name
  byte[] content = attachment.getContent();
 String fileName = attachment.getFileName();

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@aitoroses
aitoroses / gist:7bc9c0b4e4481655615a
Created April 26, 2015 13:27
HTML Mobile Metatags
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta charset="utf-8">
<link rel="apple-touch-icon" href="/assets/icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="/assets/icon.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="/assets/icon.png"/>
@aitoroses
aitoroses / . ES6 & JSX & Webpack.md
Last active August 29, 2015 14:19
Project Manifest file examples

Project files

@aitoroses
aitoroses / postcss.md
Last active August 29, 2015 14:20
Webpack Plugins
{ test:   /\.css$/, loader: "style!css!postcss" }
postcss: {
  defaults: [
    require('autoprefixer')({browsers: ['> 1%']}),
    require('csswring'),
 require('postcss-nested'),

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@aitoroses
aitoroses / LICENSE.txt
Last active August 29, 2015 14:23 — forked from tkafka/LICENSE.txt
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: