Represent maps
// rather than
const map: {[ key: string ]: string} = {
foo: 'bar',
}
#!/usr/bin/env bash | |
set -e | |
target_osx=$(sw_vers -productVersion) | |
project_dir=/Users/rkmax/development/aseprite | |
skia_dir=/Users/rkmax/development/skia | |
arch="$(uname -m)" | |
bundle_trial_url=https://www.aseprite.org/downloads/trial/Aseprite-v1.2.40-trial-macOS.dmg |
#include <bits/stdc++.h> | |
#define ll long long | |
using namespace std; | |
void setIO(string s) { | |
ios_base::sync_with_stdio(0); cin.tie(0); | |
freopen((s + ".in").c_str(), "r", stdin); | |
freopen((s + ".out").c_str(), "w", stdout); | |
} |
-- https://stackoverflow.com/questions/38923376/return-a-new-string-that-sorts-between-two-given-strings | |
create or replace function app_public.mid_string(prev text, next text) returns text as $$ | |
declare | |
v_p int; | |
v_n int; | |
v_pos int := 0; | |
v_str text; | |
begin | |
LOOP -- find leftmost non-matching character | |
v_p := CASE WHEN v_pos < char_length(prev) THEN ascii(substring(prev from v_pos + 1)) ELSE 96 END; |
See also:
vinegar.vim, which makes - open netrw in the directory of the current file, with the cursor on the current file (and pressing - again goes up a directory). Vinegar also hides a bunch of junk that's normally at the top of netrw windows, changes the default order of files, and hides files that match wildignore
.
With vinegar, . in netrw opens Vim's command line with the path to the file under the cursor at the end of the command. ! does the same but also prepends !
at the start of the command. y. copies the absolute path of the file under the cursor. ~ goes to your home dir. Ctrl+6 goes back to the file (buffer) that you had open before you opened netrw.
To launch netrw:
/** | |
* This code is licensed under the terms of the MIT license | |
* | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { |