Skip to content

Instantly share code, notes, and snippets.

View joaoneto's full-sized avatar

João Neto joaoneto

View GitHub Profile
@joaoneto
joaoneto / node_env.py
Created March 30, 2013 19:10
Sublime Text 2 Package NVM node path configuration
# Sublime package NVM node path configuration
# Save this file in:
# ~/.config/sublime-text-2/Packages/node_env.py
import os
os.environ["PATH"] = "/home/joao/.nvm/v0.10.2/bin:/home/joao/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
print "PATH=" + os.environ["PATH"]
@joaoneto
joaoneto / .bashrc_ps1
Last active December 13, 2015 18:18
Put .bashrc_ps1 in your home (~/) and at the end of your .bashrc add follow lines: if [ -f ~/.bashrc_ps1 ]; then . ~/.bashrc_ps1 fi
# Put .bashrc_ps1 in your home (~/) and at the end of your .bashrc add follow lines:
# if [ -f ~/.bashrc_ps1 ]; then
# . ~/.bashrc_ps1
# fi
RED='\[\e[0;31m\]'
BRED='\[\e[1;31m\]'
BLUE='\[\e[0;34m\]'
BBLUE='\[\e[1;34m\]'
CYAN='\[\e[0;36m\]'
@joaoneto
joaoneto / changelog.php
Last active December 11, 2015 23:48
Transform GIT LOG into a cute format Changelog.md
<?php
/**
* Changelog Markdown
*
* This is a script to transform GIT LOG into a cute format Changelog.md
*
* To use, set executable permissions to this file and execute:
* $ php changelog.php > CHANGELOG.md
*
* Copyright (c) 2014 João Pinto Neto
@joaoneto
joaoneto / SiblingsTreeTable.js
Created May 15, 2012 00:45
Tree in the table, with hierarchical siblings nodes. As if the siblings they were the children nodes
/*
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<style type="text/css">
table { width: 100% }
table tr.produto-servico,
table tr.produto-servico-detalhe { display: none }
</style>
@joaoneto
joaoneto / scheduler.ino
Created April 22, 2012 19:29
Sketch aJson library
/**
* aJson
* http://interactive-matter.eu/how-to/ajson-arduino-json-library/
*/
#include <aJSON.h>
#include <Time.h>
#include <TimeAlarms.h>
void setup() {
Serial.begin(9600);
@joaoneto
joaoneto / start_redis_and_couchdb.sh
Created September 3, 2015 23:44
Start Redis and CouchDB from Docker container
#!/bin/bash
docker-machine start default 1> /dev/null
eval "$(docker-machine env default)"
RUNNING=$(docker inspect --format="{{ .State.Running }}" redis 2> /dev/null)
if [ $? = 1 ]; then
echo "Container redis doesn\'t exists"
docker run -d -p 6379:6379 -v `pwd`/data/redis:/data --name redis redis
fi
@joaoneto
joaoneto / static.js
Created April 5, 2015 02:01
Try hoodie hooks :P
var appName = require('./package.json').name
|| require('../../package.json').name;
var ports = require('ports');
var port = ports.getPort(appName + '-hoodie-plugin-social');
module.exports = {
// 'server.pack.post': function (pack) {
// console.log('hook: server.pack.pre called');
// },
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@joaoneto
joaoneto / dynamics.js
Created January 8, 2015 18:20
oauthio dynamics.js
var config = require('../lib/config');
module.exports = function (hoodie) {
var dbname = config.dbname;
var oauth_cofig = hoodie.config.get('oauthio_config');
var pluginDb = hoodie.database(dbname);
var oauthio = new OauthIo(hoodie, pluginDb);
var routes = {
@joaoneto
joaoneto / icon-fill.js
Created October 27, 2014 20:42
material.components.icon.extra
/**
* Markup
* <md-icon icon-fill="red" icon="'/img/icons/test.svg'" style="width: 32px; height: 32px;"></md-icon>
*/
angular.module('material.components.icon.extra', [
'ngMaterial'
])
.directive('iconFill', function () {