Skip to content

Instantly share code, notes, and snippets.

View ideiudicibus's full-sized avatar

ignazio de iudicibus ideiudicibus

View GitHub Profile
(function(undefined) {
// Get angular app
var app = angular.module("App");
app.factory("XLSXReaderService", ['$q', '$rootScope',
function($q, $rootScope) {
var service = function(data) {
angular.extend(this, data);
};
@draffensperger
draffensperger / fuzzy_name_lookup.bas
Last active November 24, 2021 13:20
Excel VBA module for fuzzy lookup (via Levenshtein distance) for a person id by first name and last name in a person range that has first, last, full and id fields.
Option Explicit
Private Type PersonQuery
firstName As String
lastName As String
fullName As String
firstNames As Range
lastNames As Range
fullNames As Range
namesSwapped As Boolean
@ideiudicibus
ideiudicibus / Beanutils.java
Created May 10, 2011 14:17
Merge two java beans useful when discovering differences
class Beanutils{
//merge two bean by discovering differences
private <M> void merge(M target, M destination) throws Exception {
BeanInfo beanInfo = Introspector.getBeanInfo(target.getClass());
// Iterate over all the attributes
for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) {
// Only copy writable attributes
if (descriptor.getWriteMethod() != null) {
@mheadd
mheadd / registrar.js
Created April 6, 2011 18:26
A simple SIP registrar that uses Node.js and Redis
var sip = require('sip');
var sys = require('sys');
var redis = require('redis');
//Trim leading and trailing whitespace from string values.
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');
}
sip.start({},function(request) {