Skip to content

Instantly share code, notes, and snippets.

View nckcol's full-sized avatar
💩
lets get shit done

Nikita Popov nckcol

💩
lets get shit done
View GitHub Profile
@nckcol
nckcol / use-priority-plus.js
Created April 3, 2023 14:52
hook implementing priority+ navigation pattern
/**
* hook implementing Priority+ Navigation pattern
*
* Reference implementation: https://github.com/gijsroge/priority-navigation
* Ported from: https://github.com/gijsroge/vue-responsive-menu
*
* Read more about pattern Priority+ Navigation:
* https://css-tricks.com/the-priority-navigation-pattern/
* https://bradfrost.com/blog/post/revisiting-the-priority-pattern/
*/
@nckcol
nckcol / rename-ext-jsx-to-js.js
Created May 6, 2022 22:16
Rename js files with .jsx extension but without actual jsx into .js
const parser = require("@babel/parser");
const traverse = require("@babel/traverse").default;
const t = require("@babel/types");
const fs = require("fs-extra");
const path = require("path");
function parse(content) {
return parser.parse(content, {
sourceType: "module",
plugins: [
/*
State example:
*/
const example = {
'section_id=1&geo_id=1': {
filters: {
loadingState: 'loaded',
config: {...}
},
sorting: {

Keybase proof

I hereby claim:

  • I am nckcol on github.
  • I am nckcol (https://keybase.io/nckcol) on keybase.
  • I have a public key ASAneGHQoq3RYAYnSIgRgyXcLNn98KLpAWiHrj2zwO1LFQo

To claim this, I am signing this object:

@nckcol
nckcol / command-line-tools.md
Created November 11, 2018 17:10
Command Line Tools
@nckcol
nckcol / lock_fn.scss
Last active November 12, 2016 20:18
SCSS function for css lock https://fvsch.com/code/css-locks/
@function lock($min_value /* em */, $max_value /* em */, $min_width /* em */, $max_width /* em */) {
@return calc(
#{$min_value}
+ (#{$max_value/1em} - #{$min_value/1em})
* (100vw - #{$min_width})
/ (#{$max_width/1em} - #{$min_width/1em})
);
}
// CodePen Sample http://codepen.io/nckcol/pen/aBNJXP
@nckcol
nckcol / gist:05f5864c2aa2a70e7936c9aa321ddc78
Created March 30, 2016 22:01
gulpfile_es6_browserify_sass.js
'use strict';
import browserSync, { reload } from 'browser-sync';
import browserify from 'gulp-browserify';
import fs from 'fs';
import gulp from 'gulp';
import autoprefixer from 'autoprefixer';
import babel from 'gulp-babel';
import cache from 'gulp-cache';
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@nckcol
nckcol / 0_reuse_code.js
Created September 26, 2013 18:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console