Skip to content

Instantly share code, notes, and snippets.

Nurbek nurbek-ab

  • Russia
Block or report user

Report or block nurbek-ab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nurbek-ab
nurbek-ab / install react-devtools v3
Created Aug 31, 2019 — forked from oztune/install react-devtools v3
How to install React Dev Tools v3 so that you can have highlight updates again
View install react-devtools v3
1. Somewhere on your machine clone the project.
```
> git clone https://github.com/facebook/react-devtools.git
> cd react-devtools
```
2. Switch to the v3 branch
```
> git checkout v3
```
@nurbek-ab
nurbek-ab / git-ssh-auth-win-setup.md
Created Jan 5, 2019 — forked from bsara/git-ssh-auth-win-setup.md
Setup SSH Authentication for Git Bash on Windows
View git-ssh-auth-win-setup.md

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
    • .ssh/config
@nurbek-ab
nurbek-ab / simple-pagination.js
Created Mar 28, 2018 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
View simple-pagination.js
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@nurbek-ab
nurbek-ab / outOfViewport.js
Last active Nov 15, 2017 — forked from LukyVj/outOfViewport.js
Detect which elements overlap your document width.
View outOfViewport.js
function outOfViewport(colorWrapper, colorTag, colorClass) {
const bodyWidth = document.body.offsetWidth;
const list = document.querySelectorAll('*');
for (let elem of list) {
if (elem.offsetWidth > bodyWidth) {
console.log(
`%c [` +
`%c` + elem.tagName +
`%c.` + elem.classList +
`%c]` +
@nurbek-ab
nurbek-ab / really-right-breakpoints.less
Created Nov 8, 2017 — forked from markhowellsmead/really-right-breakpoints.less
The 100% correct way to do CSS breakpoints - LESS variables
View really-right-breakpoints.less
/*
Thanks David <3 - https://medium.freecodecamp.com/the-100-correct-way-to-do-css-breakpoints-88d6a5ba1862
*/
@for-phone: ~"screen and (max-width: 44.9375rem)"; // < 720
@for-tablet-only: ~"screen and (min-width: 45rem) and (max-width: 74.9375rem)"; // > 720 < 1199
@for-tablet-portrait-only: ~"screen and (min-width: 45rem) and (max-width: 56.1875rem)"; // > 720 < 900
@for-tablet-portrait-up: ~"screen and (min-width: 45rem)"; // > 720
@for-tablet-landscape-up: ~"screen and (min-width: 56.25rem)"; // > 900
@for-desktop-up: ~"screen and (min-width: 75rem)"; // > 1200
@for-big-desktop-up: ~"screen and (min-width: 112.5rem)"; // > 1800
@nurbek-ab
nurbek-ab / diff.js
Created Jan 11, 2017
Show diff between two javascript objects
View diff.js
// http://stackoverflow.com/questions/31683075/how-to-do-a-deep-comparison-between-2-objects-with-lodash
function compare(a, b) {
var result = {
different: [],
missing_from_first: [],
missing_from_second: []
};
_.reduce(a, function (result, value, key) {
@nurbek-ab
nurbek-ab / modal-centered.css
Created Oct 31, 2016
Bootstrap modal centered vertically via CSS only.
View modal-centered.css
/*https://codepen.io/dimbslmh/full/mKfCc*/
.modal {
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 100%;
@nurbek-ab
nurbek-ab / isDateString.js
Created Jun 24, 2016
Check if a string is a date string
View isDateString.js
function isDateString(str) {
return !isNaN(Date.parse(str));
}
@nurbek-ab
nurbek-ab / inspect.js
Last active Oct 21, 2016
Logs prettyfied and colored objects to console
View inspect.js
var util = require('util');
var _ = require('lodash');
/**
* Logs prettyfied and colored objects to console
* @param msg - message
* @param title - log message title
* @param depth - property depth
* @param showHidden - show hidden properties
*/
@nurbek-ab
nurbek-ab / wp-get_id_by_slug
Created Oct 15, 2015 — forked from davidpaulsson/wp-get_id_by_slug
WordPress: Get page ID from slug
View wp-get_id_by_slug
// Usage:
// get_id_by_slug('any-page-slug');
function get_id_by_slug($page_slug) {
$page = get_page_by_path($page_slug);
if ($page) {
return $page->ID;
} else {
return null;
}
You can’t perform that action at this time.