A metatable can be defined like
local t = setmetatable({}, {
__tostring = function() return 'custom tostring behavior!' end
})
Here are the metamethods that you can define, and their behavior
import ts from 'typescript'; | |
import path from 'node:path'; | |
import Debug from 'debug'; | |
const debug = Debug('type-check-only-project-files'); | |
// ---------------------------------------------------------------- | |
// This file is a helper file that can be used to run type check | |
// only for the files that in the project and not for any other file |
"start | |
set number "set relativenumber | |
nmap <c-x> :wq<CR> | |
imap <c-x> <Esc>:wq<CR>a | |
set whichwrap+=<,>,h,l,[,] | |
syntax on | |
map <C-n> :NERDTreeToggle<CR> | |
" |
const replacer = function( depth = Number.MAX_SAFE_INTEGER ) { | |
let objects, stack, keys; | |
return function(key, value) { | |
// very first iteration | |
if (key === '') { | |
keys = ['root']; | |
objects = [{keys: 'root', value: value}]; | |
stack = []; | |
return value; | |
} |
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Cambridge Silicon Radio\Harmony\Default] | |
"OSD"=dword:00000000 |
'use strict';
const crypto = require('crypto');
// get password's md5 hash
let password = 'test';
let password_hash = crypto.createHash('md5').update(password, 'utf-8').digest('hex').toUpperCase();
console.log('key=', password_hash); // 098F6BCD4621D373CADE4E832627B4F6
To make this work in CSS:
background: url('images.svg#chart');
or img:
<img src="images.svg#chart">
/* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |
find . -name '._*' -exec rm -f {} \; |