Skip to content

Instantly share code, notes, and snippets.

View joaoneto's full-sized avatar

João Neto joaoneto

View GitHub Profile
@joaoneto
joaoneto / README.md
Last active May 23, 2016 21:12
Improve your curl with pretty formmated json responses

Improve your curl with pretty formmated json responses

requirements node.js

add in your .zshrc

[[ -s $HOME/bin/prettycurl.sh ]] && . $HOME/bin/prettycurl.sh
const React = require('react');
const ReactAtellier = require('react-atellier')(React);
class AtellierWrapper extends React.Component {
static propTypes = { message: React.PropTypes.string };
static defaultProps = { message: 'Hello World!' };
render() {
const Icon = React.createClass({
render: function() {
return (
@joaoneto
joaoneto / .profile
Last active January 26, 2016 13:31
Mac OS .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
@joaoneto
joaoneto / ATOM_PACKAGES.md
Last active January 18, 2016 17:32
Util Atom packages

Atom Packages

apm instal \
aligner \
atom-beautify \
autoclose-html \
autocomplete-paths \
color-picker \
editorconfig \
file-icons \
@joaoneto
joaoneto / env.sh
Created September 14, 2013 18:26 — forked from pulkitsinghal/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 September 13, 2013 00:34
Nice zenity installer example
#!/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 December 22, 2015 15:18
Start services, if they are not running
#!/bin/bash
EXITCODE="0"
SERVICES=(
"memcached &"
"mongod &"
"redis-server &"
"neo4j start"
"elasticsearch"
@joaoneto
joaoneto / demo.js
Created July 26, 2013 00:29
This gist is to climb a static server, with just one command, to test the examples of several projects that need a web server. Usage: $ npm install express; curl -ks https://gist.github.com/joaoneto/6085097/raw/761598ddb44f390179617702740fe7fbf62f6187/demo.js | node
var express = require('express'),
app = express(),
port = process.argv[2] || process.env.PORT || 9000,
webroot = process.argv[3] || process.env.WEBROOT || './demo';
app
.use(express.bodyParser())
.use(express.cookieParser())
.use(app.router)
.use(express.static(__dirname + '/' + webroot))
.listen(port, function () { console.log('Demo is running on: http://localhost:' + port); });
@joaoneto
joaoneto / jquery_ajax_cors.html
Created April 29, 2013 05:57
jQuery ajax with CORS
<!doctype html>
<html>
<header>
<title>Dev tools</title>
</header>
<body>
<h1>Dev tools</h1>
<div data-scope="main"></div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="socket.io.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {