A distributed Key value store is part of consul.io
// SPDX-License-Identifier: MIT | |
// Author: vectorized.eth | |
pragma solidity ^0.8.0; | |
pragma abicoder v2; | |
// DISCLAIMER: | |
// This is experimental software and is provided on an "as is" and "as available" basis. | |
// We do not give any warranties and will not be liable for any loss incurred through any use of this codebase. | |
library Base64 { |
//inspired by https://github.com/wspringer/angular-pouchdb | |
//lawnchar simple wrapper | |
// | |
//It wraps Lawnchair as a provider, allowing you to set global configuration before your | |
//dependencies are getting injected | |
// | |
//It uses $q-based promises instead of callbacks: db.get({...}) will return a promise with the results, | |
//and no longer accepts a callback as the last parameter. | |
//The same goes for all other operations that normally required callbacks. | |
// |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
query_to_hash = function() { | |
var j, q; | |
q = window.location.search.replace(/\?/, "").split("&"); | |
j = {}; | |
$.each(q, function(i, arr) { | |
arr = arr.split('='); | |
return j[arr[0]] = arr[1]; | |
}); | |
return j; | |
} |
[ | |
{ "keys": ["ctrl+shift+t"], "command": "open_terminal_project_folder" }, | |
{ "keys": ["ctrl+tab"], "command": "next_view" }, | |
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" } | |
] |
var baseUrl = 'https://api.parse.com/1', | |
appId = 'XXXXXXXXXXXXXXX', | |
apiKey = 'XXXXXXXXXXXXXX'; // make sure to use the REST API Key | |
var _register = function(params, lambda, lambdaerror) { | |
var method = 'POST', | |
url = baseUrl + '/installations', | |
payload = (params) ? JSON.stringify(params) : ''; | |
_helper(url, method, payload, function(data, status) { |
/* | |
fileExistSync - Check if a file exist in NodeJS | |
Twitter: @FGRibreau / fgribreau.com | |
Usage: | |
var fileExistSync = require('./fileExistSync'); | |
var exist = fileExistSync('/var/folders/zm/jmjb49l172g6g/T/65b199'); | |
Support for Nodev0.6 |
Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.
Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.
On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation
var _ = require('underscore'), | |
util = require('util'); | |
// intercept stdout, passes thru callback | |
// also pass console.error thru stdout so it goes to callback too | |
// (stdout.write and stderr.write are both refs to the same stream.write function) | |
// returns an unhook() function, call when done intercepting | |
module.exports = function interceptStdout(callback) { | |
var old_stdout_write = process.stdout.write, | |
old_console_error = console.error; |