Skip to content

Instantly share code, notes, and snippets.

@likerRr
likerRr / weather.html
Created January 24, 2021 17:55
weather widget for notion
<a class="weatherwidget-io" href="https://forecast7.com/ru/53d9027d56/minsk/" data-label_1="MINSK" data-label_2="WEATHER" data-theme="original" >MINSK WEATHER</a>
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='https://weatherwidget.io/js/widget.min.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','weatherwidget-io-js');
</script>
download on
first run
download on
next run
requires
package-lock.json
modifies
package-lock.json
deletes
node_modules
allows
install a single package
speed
npm i y if not found in cache
or cache is corrupted
no yes no yes normal
npm ci y if not found in cache
or cache is corrupted
yes no yes no fast
@likerRr
likerRr / optional_accessor.js
Created February 14, 2020 07:14
Allows deeply access object properties through Proxies
{
const accessor = Symbol('accessor');
function createAccessor() {
function fn() {}
fn[accessor] = true;
return new Proxy(fn, {
apply() {
@likerRr
likerRr / 1. Readme.md
Last active May 22, 2018 10:17
Webpack's `require.context` emulation for nodejs

Webpack's require.context is a powerful feature which helps to extract an array of paths within which the search of modules will be done. e.g.:

const requireFromContext = require.context(__dirname, true, /config\.js$/);
// Now `requireFromContext` contains files inside `__dirname/config` folder and which extension is `.js`

require.context is a special feature of webpack. Native nodejs's require doesn't containt that method and if you want to run unbundled code on nodejs, then you have to emulate require.context.

@likerRr
likerRr / font-weight-names
Created January 3, 2017 07:04
Usual names for `font-weight` CSS property
// http://www.webtype.com/info/articles/fonts-weights/
100 Extra Light, Ultra Light
200 Light or Thin
300 Book or Demi
400 Normal or Regular
500 Medium
600 Semibold, Demibold
700 Bold
800 Black, Extra Bold or Heavy
900 Extra Black, Fat, Poster or Ultra Black
@likerRr
likerRr / 020_add_android_permissions.js
Last active August 21, 2020 18:24
Add permissions to AndroidManifest.xml with cordova hook for Ionic 2
/*
This script uses as a cordova hook and provides ability to add android permissions to AndroidManifest.xml on the fly. It also
checks and computes which of provided permissions are already added and didn't rewrite AndroidManifest.xml if no permissions provided.
Executes only for android platform.
Prerequirements:
- node 4.2+
- npm modules: lodash, xml2js
Distributed under the MIT license.
@likerRr
likerRr / hypenate.css
Created September 28, 2015 07:08
Right way to hyphenate long words in CSS
// https://justmarkup.com/log/2015/07/31/dealing-with-long-words-in-css/
.hyphenate {
overflow-wrap: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@likerRr
likerRr / README.me
Created September 25, 2015 14:18
Vagrant shared symlinks setup
Solves problem between windows (host) and linux (vagrant), when there are symlinks in shared folders at linux machine.
With this config symlinks will search at the machine, where they were created
@likerRr
likerRr / Rain Effect.html
Last active August 29, 2015 14:27
jquery-epulse Rain Effect
<div id="rain-container"></div>
@likerRr
likerRr / Ripple Button.html
Last active August 29, 2015 14:27
jquery-epulse Ripple Button
<button id="ripple-button">Ripple button</button>