Skip to content

Instantly share code, notes, and snippets.

View bekliev's full-sized avatar
😉
Babe! How ya doin?

IBRAGIM (PARVIZ BEKLIEV) bekliev

😉
Babe! How ya doin?
View GitHub Profile
// This is a list of your own shortcuts for Telegram Desktop
// You can see full list of commands in the 'shortcuts-default.json' file
// Place a null value instead of a command string to switch the shortcut off
[
// The two commands below are "inactive"
// {
// "command": "close_telegram",
// "keys": "ctrl+f4"
// },
@stwilz
stwilz / curryMapGetters.js
Created July 25, 2019 04:27
A curry utility for passing additional arguments to `mapGetters`.
import { mapGetters } from "vuex";
const curryMapGetters = args => (namespace, getters) =>
Object.entries(mapGetters(namespace, getters)).reduce(
(acc, [getter, fn]) => ({
...acc,
[getter]: state =>
fn.call(state)(...(Array.isArray(args) ? args : [args]))
}),
{}
@marianoviola
marianoviola / rollup.config.js
Last active April 16, 2022 05:04
Svelte style preprocessor using PostCSS
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import buble from 'rollup-plugin-buble';
import uglify from 'rollup-plugin-uglify';
import postcss from 'postcss';
import postcssImport from 'postcss-import';
import postcssCssnext from 'postcss-cssnext';
const production = !process.env.ROLLUP_WATCH;
@wojteklu
wojteklu / clean_code.md
Last active June 29, 2024 08:22
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@paulirish
paulirish / what-forces-layout.md
Last active June 26, 2024 20:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@andrew8088
andrew8088 / stringify.js
Last active August 23, 2022 07:54
A simple implementation of JSON.stringify; covers every case I could think of
function stringify(obj) {
if (typeof obj !== 'object' || obj === null || obj instanceof Array) {
return value(obj);
}
return '{' + Object.keys(obj).map(function (k) {
return (typeof obj[k] === 'function') ? null : '"' + k + '":' + value(obj[k]);
}).filter(function (i) { return i; }) + '}';
}
@rcullito
rcullito / gist:cd4513766e112387b9c8
Created May 6, 2014 01:51
ElasticSearch Fuzzy Query, Favor Exact Matches
{
"query": {
"bool": {
"should": [
{
"match": {
"_all": search_term
}
},
{
@rajvanshipradeep15
rajvanshipradeep15 / detect end of scroll in div
Created September 18, 2013 09:33
Detect end of scroll in a div
<style type="text/css">
div.scroll
{
width:500px;
height:400px;
overflow:scroll;
}
</style>
<div class="scroll">
some text is present