Instantly share code, notes, and snippets.

💻
Focusing on a nodejs project

# Ali Torkiali-master

💻
Focusing on a nodejs project
• Sort options
Created May 4, 2019
Identify and validate Iranian's sheba code

### Usage

`identifyIBAN("IR320700001000117163068001"); // { isVerify: true, bankName: 'بانک قرض الحسنه رسالت' }`
Last active Apr 24, 2019
Update Snappfood order page

## Install

1. Install the tampermonkey extension.
3. Go to snappfood.com and then click on an order in orders page.
4. Open the browser console
5. Call one of these functions in console

### Change date

``````updateDate("۱۳۹۸/۰۱/۱۲");
``````
Created Jan 8, 2019
Convert Hex color code to RGB and vice versa.
View hexToRgb.js
 function hexToRgb(hex) { // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])\$/i hex = hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b) const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})\$/i.exec(hex) return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16),
Created Jan 8, 2019
Moves an array item from one position in an array to another.
View move.js
 /* #move - Moves an array item from one position in an array to another. Note: This is a pure function so a new array will be returned, instead of altering the array argument. Arguments: 1. array (String) : Array in which to move an item. (required) 2. moveIndex (Object) : The index of the item to move. (required) 3. toIndex (Object) : The index to move item at moveIndex to. (required) */ function move(array, moveIndex, toIndex) { let item = array[moveIndex]
Created Oct 3, 2018 — forked from MikeNats/pm2.json
using PM2 for run ES6 (babel) application
View pm2.json
 { "apps": [{ "name": "Application", "exec_interpreter": "./node_modules/babel-cli/bin/babel-node.js", "script": "./bin/www", "args": [], "watch": ["public", "package.json", "pm2.development.json"], "ignore_watch": ["public"], "watch_options": { "persistent": true,
Created Jun 2, 2018
Adding props to react component children.
 let props = { currentStep: this.state.step + 1, totalSteps: this.props.children.length, nextStep: this.nextStep.bind(this), previousStep: this.previousStep.bind(this), goToStep: this.goToStep.bind(this), firstStep: this.firstStep.bind(this), lastStep: this.lastStep.bind(this), }
Created May 3, 2018
Show crosses for missing values in highcharts
View highcharts-crosses-missing-value.js
 /** * Highcharts plugin to draw crosses for null points */ (function(H) { H.wrap(H.Series.prototype, "drawPoints", function(proceed) { var series = this, points = this.points, renderer = this.chart.renderer; proceed.call(this);
Last active Mar 8, 2018
automatic update by http://atom.io/packages/sync-settings
Created Dec 3, 2017 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
View destructuring.js
 // === Arrays var [a, b] = [1, 2]; console.log(a, b); //=> 1 2 // Use from functions, only select from pattern var foo = () => [1, 2, 3];
Created Oct 22, 2017 — forked from developit/unistore.js
dead simple centralized state container ("store"), with preact bindings.
View unistore.js
 import { h, Component } from 'preact'; /** Creates a new store, which is a tiny evented state container. * @example * let store = createStore(); * store.subscribe( state => console.log(state) ); * store.setState({ a: 'b' }); // logs { a: 'b' } * store.setState({ c: 'd' }); // logs { c: 'd' } */
You can’t perform that action at this time.