Skip to content

Instantly share code, notes, and snippets.

View joaoneto's full-sized avatar

João Neto joaoneto

View GitHub Profile
<!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) {
@ryanflorence
ryanflorence / static_server.js
Last active April 26, 2024 16:18
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@siraj
siraj / build-essential.sh
Created November 28, 2011 05:56 — forked from henry0312/build-essential.sh
Build m4, autoconf, automake, libtool on Mac OS X Lion
#!/bin/sh
# 初期設定
WORK=$HOME/Builds/build-essential
PREFIX=$HOME/local
export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src
./node_modules/.bin/$@
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 5, 2024 13:30
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@ryanjbonnell
ryanjbonnell / gist:3880048
Last active March 23, 2023 18:01
Install Memcache on Mac OS X 10.8 "Mountain Lion"
# memcached requires libevent
cd /usr/local/src
curl -L -O http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz
tar -xvzf libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable*
./configure
make
sudo make install
# Compile memcached utility
@max-mapper
max-mapper / readme.md
Last active June 3, 2020 00:31
automatically scan for and join open internet enabled wifi networks on linux using node.js (tested on raspberry pi raspbian)
@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 / .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\]'
@justinvw
justinvw / es_simple_autocomplete_example_config.sh
Last active January 26, 2021 17:15
Simple ElasticSearch autocomplete example configuration. The 'autocomplete' functionality is accomplished by lowercasing, character folding and n-gram tokenization of a specific indexed field (in this case "city").
# Delete the possibly existing autocomplete test index
curl -X DELETE localhost:9200/autocomplete_test
# Put the config of the autocomplete index
curl -X PUT localhost:9200/autocomplete_test -d '
{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {