Skip to content

Instantly share code, notes, and snippets.

View pydawan's full-sized avatar

Thiago Monteiro pydawan

View GitHub Profile
@hgbrown
hgbrown / search.groovy
Created December 29, 2013 16:39
GROOVY:Groovy Grape Example with documentation
#!/usr/bin/env groovy
/**
* Demonstrates how to use Grape to grab dependencies for
* Groovy scripts.
*
* Grape stands for the Groovy Adaptable (Advanced) Packaging Engine, and it is a part of the Groovy installation.
* Grape helps you download and cache external dependencies from within your script with a set of simple annotations.
*
* If, in your script, you require an external dependency, that you know is available in a public repository as Maven Central Repository,
@alexandreaquiles
alexandreaquiles / UploadArquivoServlet.java
Last active April 11, 2025 13:59
Servlet que faz upload de arquivos no diretório configurado no init-param "diretorio", utilizando a biblioteca commons-fileupload.
package upload;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
<!-- todo add 'endorsed groovy extensions' resolver here -->
<ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
@ozh
ozh / composer-proxy.md
Created March 24, 2014 23:30
Using Composer behind a proxy

Define the proxy in the CLI :

$ export https_proxy='87.248.188.202:8080'
$ export http_proxy='87.248.188.202:8080'

Check proxy :

@leocomelli
leocomelli / git.md
Last active November 2, 2025 14:56
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@staltz
staltz / introrx.md
Last active October 26, 2025 03:06
The introduction to Reactive Programming you've been missing
@chrisveness
chrisveness / utf8-regex.js
Last active May 25, 2023 01:53
Utf8 string encode/decode using regular expressions
/**
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only).
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars.
*
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)),
* but this approach may be useful in other languages.
*
* @param {string} unicodeString - Unicode string to be encoded as UTF-8.
@dstroot
dstroot / app.js
Created July 13, 2014 16:29
Gulp, BrowserSync, Node, and Nodemon all working in harmony. ;)
/**
* World's simplest express server
* - used to serve index.html from /public
*/
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use(serveStatic(__dirname + '/public'));