This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PouchDB = require('pouchdb'); | |
var local = new PouchDB('./db'); | |
function createDB () { | |
var promise = Promise.resolve(); | |
var docs = []; | |
for (var i=0; i<100; i++) { | |
docs.push({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read optional requirejs-config.json | |
var promise = _mergeConfig(extensionConfig).then(function (mergedConfig) { | |
// Create new RequireJS context and load extension entry point | |
var extensionRequire = brackets.libRequire.config(mergedConfig), | |
extensionRequireDeferred = new $.Deferred(); | |
contexts[name] = extensionRequire; | |
extensionRequire([entryPoint], extensionRequireDeferred.resolve, extensionRequireDeferred.reject); | |
return extensionRequireDeferred.promise(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys, numpy | |
categories = numpy.loadtxt(sys.argv[1], str, delimiter="\t") | |
scores = numpy.load(sys.argv[2]) | |
top_k = 10 | |
prediction = zip(scores[0].tolist(), categories) | |
prediction.sort(cmp=lambda x, y: cmp(x[0], y[0]), reverse=True) | |
for rank, (score, name) in enumerate(prediction[:top_k], start=1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import caffe | |
import numpy as np | |
import sys | |
if len(sys.argv) != 3: | |
print "Usage: python convert_protomean.py proto.mean out.npy" | |
sys.exit() | |
blob = caffe.proto.caffe_pb2.BlobProto() | |
data = open( sys.argv[1] , 'rb' ).read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Save it to ~/Library/Thunderbird/Profiles/*.default/chrome/userContent.css */ | |
span[_moz_quote=true] { | |
color: orange !important; | |
} | |
pre[_moz_quote=true] { | |
color: orange !important; | |
} | |
blockquote[type=cite] { | |
color: orange !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function() { | |
var Ap = Array.prototype; | |
var slice = Ap.slice; | |
var Fp = Function.prototype; | |
if (!Fp.bind) { | |
// PhantomJS doesn't support Function.prototype.bind natively, so | |
// polyfill it whenever this module is required. | |
Fp.bind = function(context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var Ap = Array.prototype; | |
var slice = Ap.slice; | |
var Fp = Function.prototype; | |
if (!Fp.bind) { | |
// PhantomJS doesn't support Function.prototype.bind natively, so | |
// polyfill it whenever this module is required. | |
Fp.bind = function(context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SIGSEGV | |
_mh_execute_header | |
Crashed Thread | |
0 | |
Foundation 0x34fc5b14 +[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:] | |
1 | |
Foundation 0x34fd309b NSKeyValueNotifyObserver | |
2 | |
Foundation 0x34fd2da5 NSKeyValueDidChange |