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
FuzzyMatch = require 'fuzzy-matching' | |
PouchDB = require 'pouchdb' | |
_ = require 'underscore' | |
database = new PouchDB("http://****:*******@gooseberry.tangerinecentral.org:5984/gooseberry") | |
database.get "tusome teacher zones" | |
.then (doc) => | |
zones = _(doc.data).chain().map (row) => | |
row.Zone.replace(/\(.*\)/, "").trim() |
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
#!/bin/sh | |
# | |
# Janos Kasza (@janoskk) | |
# | |
# Creates (if necessary) and replicates all databases from a couchdb server to another one | |
# | |
if [ -z "$2" ]; then | |
cat <<EOF | |
Usage: $0 <sourceUrl> <targetUrl> |
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
{"id":"user.mmckay","rev":"483-3aa701c325713bc5188c725b2cff5eed","rev_tree":[{"pos":481,"ids":["56bc58ec9e722170a1f7e1e853b9e80a",{"status":"available"},[["5c8362fc2fdd4202bc96b4aed9f42388",{"status":"available"},[["a7a68d1e78f54bbba45d5dfb4b90a8fa",{"status":"available"},[["3825e6364907403d9509c023b1a4872c",{"status":"available"},[["020734783608439ba9b2beb4e910d7d0",{"status":"available"},[]]]]]]]]]]},{"pos":483,"ids":["3aa701c325713bc5188c725b2cff5eed",{"status":"available"},[]]}],"winningRev":"485-020734783608439ba9b2beb4e910d7d0","deleted":false,"seq":715} |
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
db = new PouchDB() | |
user = "user.mmckay" | |
db.get user, | |
revs_info: true | |
.then (result) -> | |
availableRevs = _(result._revs_info).chain().filter (rev) -> | |
rev.status is "available" | |
.pluck("rev").value() | |
_(availableRevs).each (rev) -> | |
db.get user, |
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
originalResultSync = Result::sync | |
Result::sync = (method, model, options) => | |
console.log method | |
console.log model | |
console.log options | |
if method is "update" or method is "create" | |
newModelAttributes = { | |
_id: model.get "_id" | |
} |
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
request = require 'request' | |
glob = require 'glob' | |
_ = require 'underscore' | |
database = process.argv.pop() | |
glob "**/*.coffee", (er, files) -> | |
_(files).each (view) -> | |
return if view.match(/__reduce/) or view is "executeViews.coffee" |
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 ruby | |
require 'rubygems' | |
require 'couchrest' | |
require 'json' | |
@db = CouchRest.new(ARGV[0]).database!(ARGV[1]) | |
#Get all .coffee files | |
Dir.glob("*.coffee").each do |view| | |
next unless view.match(/__reduce/).nil? |
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 strict'; | |
var tablesort = require('tablesort'); | |
function cleanNumber(i) { | |
return i.replace(/[^\-?0-9.]/g, ''); | |
} | |
function compareNumber(a, b) { | |
a = parseFloat(a); |
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
cat Pandora\ Songs | sed -r 's/^/gvsearch1:/' | xargs -d '\n' --max-args=1 youtube-dl -x --audio-format mp3 |
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
JSONC = require './public/JSONC.js' | |
s = "H8KLCADCswRiVAIDbVdNb8OcNhDDvSvDgl56w4klPcO6NsKywrhawopLUcKQw4QVwrzChVEEwq7DkRgIaiNNDkXDkMO/w543H8Kkw5ZtwpHDgDscccK5w4N5b8Oewox+HH59w7nDrXB3w6jCn1/Cm8OTw4vDs8OXT1/Cnz7Dv3XDuHDDuFzDrcK7H8KHwpAXP8O6ZnLCsSVew5/CnyjCuEbDvh7Drn7DoSXDvsKPHl/Do8OPwoHCisKdw4bCnmB0wqlLw7gIwr5NIcOJwqPDoMOvT3nDrDfCssOVw5nCj8KdWBvCnR0+I3V4wpzDhVrDjcOVw6bCq8KXw63DscOowoPDn8O4w6DDmMK7wrPCi2rCpV7Cj8KOw6/CjsKOIcONaTnDmSPDnMKiwrczLjnCqnPDrMOIwr45w7Y/UWzDpcOgKQ/Cum/DocKzw5hYfcOrZz9ew5nDjjjCvMOTw7MvfsOFJcOTw4DDtkYzw4nDhyYrwrfCnHh5w7USw4rCo8OEw4LCliYMwpnCrAnDq2lzJWMhw6HCj8KYGVt6w7UPCXFxEgJvw5bCnMK5wrHCk1Bhw7RuEMOLL8O4wq1mwqLDscKqw4vCksOewpzDsV9yGXDCkB7DiTYiw58swrV9wrZ8wrXDuSHCq8OVUw8ULMKjDmdaekcqOHgYFk4cfGzDjcKNIB9Kw6QxFBxXXMOZK8KSa8K9RcOMw7A6w419DcKNw4ErfEIOwqMvwqYXwo4sK8KdwqjDpTNxwq1VfzNvIMOCwqggIG10eMO8wpvCk8K1BMKJdSfCrlxFwpItKHh2fzgcPQLClsKMHcKzw7HDkMKPSRPDjsKPFm80RW7Cmj1Dw6BywqdkHcKcEgNJw6XCqxnChRnDucOGLsK2U8K0w7lYUmrCoEd/wqrDnGXDljUbwrIqFMKKXBZJwojCmwM1wpHDuhPDjcOgw6HCjWdhTxDDj8KKSijCnMOFwr3CmsK4U8 |
NewerOlder