Skip to content

Instantly share code, notes, and snippets.

View my8bit's full-sized avatar
🔑
💀‎‍💻忍者🐒

Ihor Pavlenko my8bit

🔑
💀‎‍💻忍者🐒
View GitHub Profile
@kennetpostigo
kennetpostigo / Migrating.md
Last active June 2, 2021 17:44
How I migrated from ReactRouter v2 to v4

First couple things I thought about when migrating after reading the docs

So migrating my existing app wasn't as troublesome as I originally thought. First thing I did was take a look at my router and routes and figure try to make a mental model of all the files where I had nested routes in the existing app because those components/containers will contain {this.props.children}. So I need to replace those with the nested <Match /> components.

So just to give an example:

In v2:

<Router history={history}>
  <Route path="/" component={App}>
@davidgljay
davidgljay / ComponentIndex.js
Last active June 12, 2022 19:22
Pattern for dynamically loading React components based on a config json object.
import config from '../config'
let components = {}
//For each component in the config fiel into an object
for (var i = config.length - 1; i >= 0; i--) {
components[config[i].name] = require(config[i].path).default
}
export default components
@biilmann
biilmann / readme.md
Created October 14, 2015 22:07
Quick Guide to Private NPM Modules on Netlify

Using NPM Private Modules on Netlify

Create a .npmrc file for your project like this:

//registry.npmjs.org/:_authToken=${NPM_TOKEN}

Then find your token inside the ~/.npmrc file in your home folder and set it as an NPM_TOKEN environment variable through netlify's admin UI.

@christian-bromann
christian-bromann / webdriverio.js
Created September 24, 2014 16:02
chromeoptions in webdriverio
var client = require("webdriverio").remote({
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['window-size=2880,1800']
}
}
})
@IceCreamYou
IceCreamYou / Inc 500 TSV
Created March 20, 2013 09:35
This script scrapes the Inc 500 data and turns it into a tab-separated values (TSV) string which can be easily imported into Excel or a database. To run it, go to http://www.inc.com/inc5000/list/2012 and execute the code in your browser's JavaScript console. Be nice! This hits the Inc site 50 times in quick succession. I don't know who technical…
/**
* Get an array containing the text nodes within a DOM node.
*
* Modified from http://stackoverflow.com/a/4399718/843621
*
* @param node Any DOM node.
* @param [includeWhitespaceNodes=false] Whether to include whitespace-only nodes.
* @param [recurse=false] Whether to get all nodes (true) or only the immediate child nodes (false).
* @return An array containing TextNodes.
*/
@ngryman
ngryman / README.md
Last active January 16, 2023 14:07
intellij javascript live templates

intellij javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.
@andrespagella
andrespagella / Custom.css
Created October 29, 2012 15:22
IR_Dark_Monokai
/**********************************************/
/*
/* IR_Dark_Monokai
/* Designed and developed by Andres Pagella (@mapagella)
/* http://www.andrespagella.com/customising-chrome-devtools
/*
/* Based on Ben Truyman's IR_Black
/* which is...
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
@alex-sherwin
alex-sherwin / ExtJS_4_1_2.sublime-completions
Created October 16, 2012 17:01
Sublime Text 2 ExtJS Completions
{
"scope": "source.js -string -comment -constant",
"completions": [
{ "trigger": "customtrigger.allowBlank\tBoolean", "contents": "allowBlank: $1${2:,}" },
{ "trigger": "customtrigger.allowOnlyWhitespace\tBoolean", "contents": "allowOnlyWhitespace: $1${2:,}" },
{ "trigger": "customtrigger.blankText\tString", "contents": "blankText: '$1'${2:,}" },
{ "trigger": "customtrigger.checkChangeBuffer\tNumber", "contents": "checkChangeBuffer: $1${2:,}" },
{ "trigger": "customtrigger.checkChangeEvents\tString[]", "contents": "checkChangeEvents: ['$1']${2:,}" },
{ "trigger": "customtrigger.dirtyCls\tString", "contents": "dirtyCls: '$1'${2:,}" },

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

@revolunet
revolunet / extjs-capture.js
Created August 22, 2011 12:14
ExtJs debug : capture all events
// to capture ALL events use:
Ext.util.Observable.prototype.fireEvent =
Ext.util.Observable.prototype.fireEvent.createInterceptor(function() {
console.log(this.name);
console.log(arguments);
return true;
});
// to capture events for a particular component:
Ext.util.Observable.capture(