Skip to content

Instantly share code, notes, and snippets.

View fernandoacorreia's full-sized avatar

Fernando Correia fernandoacorreia

View GitHub Profile
@fernandoacorreia
fernandoacorreia / Gruntfile.js
Created April 18, 2014 20:05
Gruntfile configuration to copy images from bower_components into dist/styles/images (see http://stackoverflow.com/a/16973048/376366)
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.{gif,jpeg,jpg,png}',
dest: '<%= yeoman.dist %>/images'
}, {
expand : true,
flatten : true,
@fernandoacorreia
fernandoacorreia / test3.ipynb
Created October 8, 2014 16:20
sample IPython notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BeautifulSoup==3.2.1
Jinja2==2.7.3
Mako==0.9.1
MarkupSafe==0.18
PAM==0.4.2
Pillow==2.3.0
Pygments==1.6
Twisted-Core==13.2.0
Twisted-Names==13.2.0
Twisted-Web==13.2.0
@fernandoacorreia
fernandoacorreia / gist:aaa45d00b74baa4c4e85
Last active August 29, 2015 14:14
Launch a Scala Notebook in Domino
#!/bin/bash
set -o nounset -o errexit
echo ""
echo "Downloading scala-notebook"
echo "--------------------------"
cd /tmp
wget -q https://github.com/chrismyang/scala-notebook/releases/download/0.1-SNAPSHOT/notebook-server-assembly-0.1-SNAPSHOT.jar
echo ""
@fernandoacorreia
fernandoacorreia / h5bp-twitter-bootstrap
Created February 2, 2012 00:31 — forked from mklabs/bootstrap-plugins.txt
h5bp + twitter bootstrap integration
#!/usr/bin/env bash
src=$PWD
ant_build_script_remote=https://github.com/h5bp/ant-build-script.git
h5bp_remote=git://github.com/h5bp/html5-boilerplate.git
bootstrap_remote=git://github.com/twitter/bootstrap.git
ant_build_script_branch=master
h5bp_branch=master
@fernandoacorreia
fernandoacorreia / Migrations_Configuration.cs
Created February 8, 2012 12:20
bidirectional relationships with EF Code First
using System;
namespace ConsoleApplication1.Migrations
{
using System.Data.Entity.Migrations;
internal sealed class Configuration : DbMigrationsConfiguration<DatabaseContext>
{
public Configuration()
{
@fernandoacorreia
fernandoacorreia / install-rbenv.sh
Created July 25, 2012 17:46
Install rbenv on Ubuntu 12.04
# pre-reqs
sudo apt-get install git-core build-essential libssl-dev libreadline-dev zlib1g-dev libxml2-dev libxslt-dev
# rbenv
cd
git clone https://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@fernandoacorreia
fernandoacorreia / rssaggregator.groovy
Created November 20, 2012 13:37
Improved XWiki RSS Aggregator Macro
{{groovy}}
import java.util.TreeMap;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;
import org.apache.commons.codec.binary.Base64
def urls = [];
def entries = new TreeMap();
@fernandoacorreia
fernandoacorreia / Output.txt
Created December 6, 2012 00:11
Serializes to JSON preserving type information
{
"Id": "b9c9e21a-caa4-4ed9-9282-27a54ad63ac0",
"Body": {
"$type": "ScheduleJobCommand",
"JobName": "name",
"Url": "url"
}
}
{
"Id": "36f4716c-21ee-4854-8313-25adfdd03545",
using System;
using System.Data.Services.Client;
using System.Diagnostics;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
namespace WorkerRole1
{
public class TableStorageWriter
{