Skip to content

Instantly share code, notes, and snippets.

View omrimor's full-sized avatar

Omri Mor omrimor

View GitHub Profile
{
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing options
// http://www.jshint.com/docs/options/#enforcing-options
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"es3" : true, // true: Adhere to ECMAScript 3 specification
@omrimor
omrimor / AffixWrapper.jsx
Created February 19, 2019 09:54 — forked from julianocomg/AffixWrapper.jsx
A simple affix React component.
/**
* @author Juliano Castilho <julianocomg@gmail.com>
*/
var React = require('react');
var AffixWrapper = React.createClass({
/**
* @type {Object}
*/
propTypes: {
@omrimor
omrimor / README.md
Created July 31, 2019 09:17 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@omrimor
omrimor / example.md
Created August 6, 2019 07:53 — forked from sdnts/example.md
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});
@omrimor
omrimor / gist:4c1f6d6c3c2a12b62758558ebe2b3f48
Created October 2, 2019 06:04 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@omrimor
omrimor / iterm2-solarized.md
Created October 6, 2019 05:50 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

// this is a big array of 76 items I need to split into groups of 10
const hugeArray = Array.from({ length: 76 }, (_, i) => i);
function chunkify(array, chunkSize = 10) {
// make a new array
const chunks = Array.from(
// give it however many slots are needed - in our case 8
// 1-7 with 10 items, and 8th slot will have 6
{ length: Math.ceil(array.length / chunkSize) },
// this is a map function that will fill up our slots
@omrimor
omrimor / sort.js
Created November 16, 2019 19:19 — forked from kimamula/sort.js
JavaScript asynchronous sort
/**
* return the mid value among x, y, and z
* @param x
* @param y
* @param z
* @param compare
* @returns {Promise.<*>}
*/
async function getPivot(x, y, z, compare) {
if (await compare(x, y) < 0) {
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
function DefaultLoader() {
return <div>Loading data...</div>;
}
function DefaultError() {
return <div>Something went wrong. Try again later.</div>;
}
import useNetworkStateHelper from './useNetworkStateHelper';
import ErrorComponent from './Error';
import LoadingComponent from './Loading';
import EmptyComponent from './Empty';
function MovieList({ isLoading, hasError, movies }) {
const { isBusy, showIfBusy } = useNetworkStateHelper({
loading: isLoading,
error: hasError,