Skip to content

Instantly share code, notes, and snippets.

View osx-for-hackers.sh
#!/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 Jan 8, 2015
oauthio dynamics.js
View 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 / crosswalk.js
Created Nov 1, 2014
Gulp tasks to download and update a existent cordova project with crosswallk
View crosswalk.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var shell = require('gulp-shell');
var download = require('gulp-download');
var unzip = require('gulp-unzip');
var clean = require('gulp-clean');
var runSequence = require('gulp-run-sequence');
var fs = require('fs');
var path = require('path');
var et = require('elementtree');
@joaoneto
joaoneto / icon-fill.js
Created Oct 27, 2014
material.components.icon.extra
View icon-fill.js
/**
* 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 () {
@joaoneto
joaoneto / ConnectPlugin.java
Created Jul 6, 2014
Debug - Print real Facebook Hash Key
View ConnectPlugin.java
package org.apache.cordova.facebook;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@joaoneto
joaoneto / development.js
Last active Aug 29, 2015
Config with dot getter and setter
View development.js
// DEVELOPMENT
module.exports = exports = {
"db": {
"connection1": {
"driver": "mongodb",
"url": "mongodb://localhost:27017/database_dev"
},
"connection2": {
"driver": "redis",
"url": "redis://localhost"
View env.sh
# local env.
$ export COUCH_HOST=https://xxx.couchdb.com
$ export COUCH_PORT=xxx
$ export COUCH_USERNAME=xxx
$ export COUCH_PASSWORD=xxx
$ export COUCH_DATABASE=xxx
# cloud env.
$ heroku config:add COUCH_HOST=https://xxx.couchdb.com
$ heroku config:add COUCH_PORT=xxx
@joaoneto
joaoneto / nice_zenity_example.sh
Created Sep 13, 2013
Nice zenity installer example
View nice_zenity_example.sh
#!/bin/bash
function infinite_progress {
$* 2> /dev/null
}
function verify_dependencies {
local DEPS=""
local PACKAGES=$1
for PACKAGE in $PACKAGES ; do
@joaoneto
joaoneto / start_services.sh
Last active Dec 22, 2015
Start services, if they are not running
View start_services.sh
#!/bin/bash
EXITCODE="0"
SERVICES=(
"memcached &"
"mongod &"
"redis-server &"
"neo4j start"
"elasticsearch"
@joaoneto
joaoneto / .profile
Last active Jan 26, 2016
Mac OS .profile
View .profile
alias ls="ls -G"
# alias mysql=/usr/local/mysql/bin/mysql
# alias mysqladmin=/usr/local/mysql/bin/mysqladmin
export PATH=$PATH:$HOME/bin
# export PATH=$PATH:/usr/local/mongodb/bin
# export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
### Added by the Heroku Toolbelt
You can’t perform that action at this time.