Skip to content

Instantly share code, notes, and snippets.

dmarcelino /
Created Aug 6, 2016 — forked from gregplaysguitar/
Django-haystack Whoosh backend with character folding
# -*- coding: utf-8 -*-
Whoosh backend for haystack that implements character folding, as per .
Tested with Haystack 2.4.0 and Whooch 2.7.0
To use, put this file on your path and add it to your haystack settings, eg.
dmarcelino / angular.adsense.js
Created May 22, 2015
Angular adsense example that shows ad more than 3 times
View angular.adsense.js
'use strict';
var adSenseTpl = '<div id="adsenses-ad-1"><ins class="adsbygoogle"' +
'style="display:inline-block;width:336px;height:280px"' +
'data-ad-client="ca-pub-000000000000000000"' +
var adsenseAd1;
dmarcelino / .htaccess
Created Feb 8, 2016 — forked from Zodiac1978/.htaccess
Make WordPress faster - a safe htaccess way
View .htaccess
# Sources:
dmarcelino / HintTextArea.js
Created May 19, 2012
A Titanium Mobile implementation of a TextArea with hintText compatible with iOS
View HintTextArea.js
* @author Dario Marcelino
var defaultHintTextColor = 'gray';
var filter = function (/*Object*/ source){
var newObj = {};
for(name in source){
dmarcelino / matchRecordIDs.js
Created Jun 3, 2015
Comparing strategies to match RecordID
View matchRecordIDs.js
var assert = require('assert');
var RecordId = require('oriento').RID;
var _ = require('lodash');
var N = 4000;
function matchRecordIdOriginal(id) {
if (id === null || id == undefined) return false;
var test = _.cloneDeep(id);
if(typeof test.toString !== 'undefined')
dmarcelino / npm-debug.log
Created Jun 2, 2015
npm ERR! registry error parsing json
View npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'publish' ]
2 info using npm@2.11.0
3 info using node@v0.10.36
4 verbose publish [ '.' ]
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec { raw: '.',
7 silly cache add scope: null,
7 silly cache add name: null,
dmarcelino / b62.vs.base-x.js
Created May 27, 2015
Node Base62 libraries: b62 vs. base-x
View b62.vs.base-x.js
var baseX = require('base-x')('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
var b62 = require('./b62');
var buf = new Buffer([0x30, 0x17, 0xe8, 0x92, 0xe2, 0x3d, 0xff]);
var str = "Hello World!";
var encodedX, encoded62, decodedX, decoded62, runs=100;
// warm up
dmarcelino / mocha.optional.js
Created Apr 24, 2015
Optional Mocha tests: if not pass mark as pending
View mocha.optional.js
* Sometimes there is the need to have optional tests that may need to run conditionally as discussed in:
* This solution is good but if our tests are part of a test suite that runs against many different kinds of implementations
* it may be desirable to have optional tests that "pass" if they are supported and become "pending" if they fail.
* This way we don't have to break the whole test suit because of an optional test breaksing and, if it passes, we'll know about it.
function runOptionalTest(testName, failedMessage, testFn){
dmarcelino /
Last active Aug 29, 2015
waterline-sequel badges



build integration tests npm dependencies
Build Status Circle CI npm version Dependency Status
dmarcelino / c120_air_mouse.keymap.xml
Created Feb 28, 2015
Kodi keymaps for some remotes
View c120_air_mouse.keymap.xml
<key id="61654">contextmenu</key>
<doubleclick id="0">noop</doubleclick>