Skip to content

Instantly share code, notes, and snippets.

View GermanoGiudici's full-sized avatar

Germano Giudici GermanoGiudici

View GitHub Profile
@dmethvin
dmethvin / gist:1676346
Created January 25, 2012 13:51
Breakpoint on access to a property
function debugAccess(obj, prop, debugGet){
var origValue = obj[prop];
Object.defineProperty(obj, prop, {
get: function () {
if ( debugGet )
debugger;
return origValue;
},
@nicdaCosta
nicdaCosta / Grep.js
Last active March 9, 2024 13:39
Basic function that searches / filters any object or function and returns matched properties.
/*
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.
@NV
NV / Readme.md
Last active May 28, 2023 20:42
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.

stopBefore.js

2min screencast

Examples

stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
@MartinPaulo
MartinPaulo / DevstackVagrant.md
Last active May 31, 2020 17:00
Devstack IceHouse in a Vagrant box...

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

@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing
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));
}
@mpj
mpj / README.md
Last active December 12, 2020 00:15
REALLY quick and dirty static file dev server

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.