Skip to content

Instantly share code, notes, and snippets.

@debloper
debloper / userChrome.css
Last active December 28, 2015 22:39
Sexy Tabs. Take that, Curvy Tabs! #firefoxAustralis :P
/* set default namespace to XUL */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.tabbrowser-tab[selected] { margin-top: -1px !important; }
.tab-background-middle {
border-left: none !important;
border-right: none !important;
margin: 0 -0.5px !important;
}
@debloper
debloper / bandwidth.js
Last active November 5, 2023 19:15
Determine client's connection speed with JavaScript
// Let's initialize the primitives
var startTime, endTime, fileSize;
// Set up the AJAX to perform
var xhr = new XMLHttpRequest();
// Rig the call-back... THE important part
xhr.onreadystatechange = function () {
// we only need to know when the request has completed
@debloper
debloper / mailbomb.js
Last active December 21, 2015 00:29
Brace Yourself Sawrubh, emails are coming!
var count = 21+13+8+5+3+2+1+1+0
, bumps = [
"Keep Calm & Code On...",
"May The Source Be With You!",
"Want to change the world? Good! First, go get the source code.",
"Klaatu barada nikto.",
"Less Yak, More Hack!",
"Fuck It, Ship It.",
"Keyboard not found. Press < F1 > to resume.",
"<tits>( . ) ( . )</tits>",
@debloper
debloper / app.js
Last active October 21, 2022 21:48
A simple WHOIS & Reverse Lookup server written in Node.js. Run `npm install express`, then `node <file>.js` to get the server(s) up
var net = require("net")
, dns = require("dns")
, exp = require("express")
, app = exp();
app.configure(function() {
app.use(exp.logger());
app.use(app.router);
});
@debloper
debloper / es-csv-river.md
Last active December 19, 2015 00:59
Resolving CSV River 1.0.1 to work with ElasticSearch 0.90.1

The Challenge:

Implement a river for indexing CSV files, in the running ElasticSearch 0.90.1 instance.

Low Hanging Fruit:

As listed in ES' plugins page, ES-CSV-River seemed to be able to do the job easily.

Blockers:

  • To Site, or Not To Site: it wasn't possible to install CSV-River the usual way ($ bin/plugin -install xxBedy/elasticsearch-river-csv). ES plugin-system was detecting it to be a site-plugin, but for having the Java files in it, it was confused & aborted plugin-installations.
  • Call 911 (Maven, that is): Got JAR files built from the source with Maven & installed it - that seemed to work!
  • Processing, I see: Now that I create the river, with sample JSON fit to work with the sample CSV I generated - it seems to start indexing the file, but breaking just after. It adds the .processing to the file's extension & fails, reporting traceback for Exception in opencsv.
@debloper
debloper / README.md
Last active December 13, 2015 18:19
GNUnify 2013

GitHub: it's good for you!

A hands on development session on GitHub to help you jump start with collaborative open-source developments. Good if you already know Git; if not, then it'll help you learn.

Session covers GitHub basics, issues, wikis, pull-requests and github-pages for free static web-hosting for the project-websites.

More details: https://gist.github.com/debloper/4954530

Gearing up:

Software Engineering Intern, Summer 2013 - North America
Positions are available in our North American offices.
The area: Engineering and Operations
Google is and always will be an engineering company. We hire people with a broad set of technical skills who are ready to tackle some of technology's greatest challenges and make an impact on millions, if not billions, of users. At Google, engineers not only revolutionize search, they routinely work on massive scalability and storage solutions, large-scale applications and entirely new platforms for developers around the world. From AdWords to Chrome, Android to YouTube, Social to Local, Google engineers are changing the world one technological achievement after another.
The role: Software Engineering Intern, Summer 2013
@debloper
debloper / theme.html
Last active October 13, 2015 23:08
Mozilla India Events Page Theme: http://events.mozillaindia.org
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>{Title} - Mozilla India</title>
<!-- Base theme "Clarus" by Benjamin Nathan <benjamin@benjaminnathan.nl> -->
@debloper
debloper / main.js
Created October 6, 2012 05:37
Restartless Addon Example
var contextMenu = require("context-menu");
var tabs = require("tabs");
var aboutContextMenu = contextMenu.Menu({
label: "About Pages",
contentScript: 'on("click", function (node, data) {' +
' postMessage(data.toString());' +
'});',
onMessage: function(url) {
tabs.open(url);
@debloper
debloper / detect.js
Created July 20, 2012 16:27
Feature-detecting old IE version
if (!window.addEventListener && !!window.attachEvent) {
console.log("IE lt 9");
} else {
console.log("IE gte 9");
}