CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new
# Create a promise: | |
myCoolPromise = new Promise (resolve, reject) -> | |
# do a thing | |
success = true | |
if success | |
resolve 'stuff worked' | |
else | |
reject Error 'it broke' |
# This script is to work round the problem of broken RubyMine dependencies for bundle files. | |
# It uses an undocumented feature for RubyMine (but available in Intellij Idea) to create a | |
# gems library xml file and update the iml file. | |
# | |
# See Rubymine issues: | |
# https://youtrack.jetbrains.com/issue/RUBY-16428 | |
# https://youtrack.jetbrains.com/issue/RUBY-15026 | |
# https://youtrack.jetbrains.com/issue/RUBY-14542 | |
# | |
# Usage: |
ALPHABET_SIZE = 26 | |
def caesar_cipher(string) | |
shiftyArray = [] | |
charLine = string.chars.map(&:ord) | |
shift = 1 | |
ALPHABET_SIZE.times do |shift| | |
shiftyArray << charLine.map do |c| | |
((c + shift) < 123 ? (c + shift) : (c + shift) - 26).chr |
#!/usr/bin/env ruby | |
# | |
# If you've got a collection of Bash aliases that just keeps growing... Consider using YAML! | |
# | |
# This version is designed to parse aliases organized under named groups in the YAML | |
# file, so the first level of mappings are purely semantic, and are used to keep the | |
# data organized and well-documented. | |
# | |
require 'pathname' | |
require 'yaml' |
# In my tag-filing system where top-level "context" folders are tagged with | |
# "=Context" tags and subfolders are tagged with "@project" tags, this function | |
# lets me quickly cd to any tagged folder in my filing system. The first | |
# argument is a context folder, the rest are a chain of subfolders. The | |
# subfolders don't need to be contiguous, and the matching is fuzzy. | |
cdt() { | |
local fuzzy | |
local root | |
local sub | |
local list |
#!/usr/bin/env ruby | |
# | |
# CLI tool for locating and removing a Homebrew installation | |
# It replaces the official uninstaller, which is insufficient and often breaks | |
# If files were removed, the script returns 0; otherwise it returns 1 | |
# | |
# http://brew.sh/ | |
# | |
# Copyright (C) 2025 Stephen C. Benner | |
# |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
From: http://run-node.com/littlest-database-that-could/
I've written numerous tiny databases. They don't have much features, but they don't need much features. Usually I'm looking for fast simple key/value stores and Node never disappoints. The point here is, why abstract key value store when JS gives us one for free, as it's most basic component: object.
Will it meet every need? No. But it will meet ALOT of scenarios.
In memory JS object lookups, were talking hundreds of thousands of lookups (you'll easily flood http before the db), and save hundreds of thousands of records in a JSON file written to disk. Not a 200ms r/t to some hosted Redis. Hey, that's fine if that's your thing.
Here's the requirements:
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.