Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>About Zozo</h1>
<img src="https://raw.githubusercontent.com/xavi-/random/master/zozo.jpg">
<p>
Zozo is darling puppy known for sparkling personality and agility.
@xavi-
xavi- / gist:08bd6a81e7861c29bffb
Created September 24, 2015 23:53 — forked from kvigen/gist:c5aa7e2d17e13769d929
oplog-converter
type ChangeEntry struct {
Namespace string
Type string // insert, update, or delete
ID string // the unique identifier of the object
Object map[string]interface{} // There are limitations on this object...
}
func convertOp(op map[string]interface{}) (*ChangeEntry, error) {
// Note that this has only been tested for the Mongo 2.4 format
{
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 11.0,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
[
[ "A", "a" ],
[ "AMD", "amd" ],
[ "AQ", "aq" ],
[ "Babel", "babel" ],
[ "Bag", "bag" ],
[ "Base64", "base64" ],
[ "BigInt", "bigint" ],
[ "BufferList", "bufferlist" ],
[ "ByteBuffer", "bytebuffer" ],
[
[
{
"module": "AQ",
"author": {
"name": "Kirollos Risk",
"email": "kirollos@gmail.com"
}
},
{
[
[
{
"module": "amd",
"author": {
"name": "Dominic Tarr",
"email": "dominic.tarr@gmail.com",
"url": "bit.ly/dominictarr"
}
},
// First do this:
// $ curl http://isaacs.iriscouch.com/registry/_all_docs > npmdocs.json
var docs = require("./npmdocs").rows;
var request = require("request");
var fs = require("fs");
var normalized = {};
docs.forEach(function(doc) {
@xavi-
xavi- / gist:7113797
Last active December 26, 2015 07:18
var original = {
_id: "3f369ef",
_rev: "rev-23421-12",
brand: "bran and ed",
sizes: [
{ sku: "3925", US: 10, UK: 11 },
{ sku: "4635", US: 9, UK: 10 }
]
};
@xavi-
xavi- / gist:5882483
Last active December 19, 2015 02:19
A JavaScript version of the bug described in http://stackoverflow.com/questions/17351590
// A JavaScript version of the bug described in http://stackoverflow.com/questions/17351590
var names = {};
function fetchName(id, callback) {
if(id in names) { callback(names[id]); }
else {
$.get("/what-the-name", { id: id }, function(name) {
names[id] = name;
callback(name);
});
@xavi-
xavi- / .jshintrc
Last active December 11, 2015 05:18
My JSHint settings.
{
"predef": [],
"maxerr": 150,
"browser": true,
"node": true,
"esnext": true,
"jquery": true,