Skip to content

Instantly share code, notes, and snippets.

Germano Giudici GermanoGiudici

Block or report user

Report or block GermanoGiudici

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mpj
mpj / README.md
Last active Apr 28, 2016
REALLY quick and dirty static file dev server
View README.md

Usage

node dirtyserve.js

The point your browser to

http://localhost:3000/myfile.xxx

and the server will try to serve that file from the local server.

View JdbcStreams.java
public <T> T streamQuery(String sql, Function<Stream<SqlRowSet>, ? extends T> streamer, Object... args) {
return jdbcTemplate.query(sql, resultSet -> {
final SqlRowSet rowSet = new ResultSetWrappingSqlRowSet(resultSet);
final boolean parallel = false;
// The ResultSet API has a slight impedance mismatch with Iterators, so this conditional
// simply returns an empty iterator if there are no results
if (!rowSet.next()) {
return streamer.apply(StreamSupport.stream(Spliterators.emptySpliterator(), parallel));
}
@staltz
staltz / introrx.md
Last active Nov 22, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@MartinPaulo
MartinPaulo / DevstackVagrant.md
Last active Jun 27, 2017
Devstack IceHouse in a Vagrant box...
View DevstackVagrant.md

Boxing devstack with Vagrant...

The simplest way is to install the latest version of Vagrant Then just follow the instructions given by Christian Berendt in his blog entry: http://www.cberendt.de/2014/04/an-other-vagrant-box-with-devstack-and-ubuntu-14-04/ (you might want to reduce the memory and the number of CPU's, dependent on your hardware - also, don't forget the warning about waiting for 10+ minutes once you have fired the whole thing up)

To install a specific branch of devstack

These are the steps I followed to install the icehouse branch of devstack into a Vagrant controlled VM

@NV
NV / Readme.md
Last active Apr 30, 2019
Prepend the debugger statement to a function as easy as stopBefore('Element.prototype.removeChild'). Works in Chrome DevTools and Safari Inspector, doesn’t work in Firebug‘s and Firefox Developer Tools‘ console (I don’t know why). Works as a standalone script everywhere.
View Readme.md

stopBefore.js

2min screencast

Examples

stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
@nicdaCosta
nicdaCosta / Grep.js
Last active Jul 10, 2019
Basic function that searches / filters any object or function and returns matched properties.
View Grep.js
/*
Grep.js
Author : Nic da Costa ( @nic_daCosta )
Created : 2012/11/14
Version : 0.2
(c) Nic da Costa
License : MIT, GPL licenses
Overview:
Basic function that searches / filters any object or function and returns matched properties.
@dmethvin
dmethvin / gist:1676346
Created Jan 25, 2012
Breakpoint on access to a property
View gist:1676346
function debugAccess(obj, prop, debugGet){
var origValue = obj[prop];
Object.defineProperty(obj, prop, {
get: function () {
if ( debugGet )
debugger;
return origValue;
},
You can’t perform that action at this time.