Skip to content

Instantly share code, notes, and snippets.

View kukiron's full-sized avatar
🚀
I do stuff...

Kafil Uddin Kiron kukiron

🚀
I do stuff...
View GitHub Profile
@kukiron
kukiron / ultimate-ut-cheat-sheet.md
Created August 21, 2017 04:16 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@kukiron
kukiron / ReloadPlugin.js
Created August 31, 2017 09:52 — forked from timdorr/ReloadPlugin.js
Webpack Chrome Extension Page Reloader Plugin
function ReloadPlugin() {}
ReloadPlugin.prototype.apply = compiler => {
ReloadPlugin.watching = false
compiler.plugin('watch-run', (p, cb) => {
ReloadPlugin.watching = true
cb()
})
@kukiron
kukiron / README.md
Created September 10, 2017 13:19 — forked from int128/README.md
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@kukiron
kukiron / sublime-text-3-setup.md
Created September 13, 2017 13:52 — forked from ijy/sublime-text-3-setup.md
My Sublime Text 3 setup.

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following:
@kukiron
kukiron / .eslintrc.js
Created October 15, 2017 06:03 — forked from adrianhall/.eslintrc.js
A sample .eslintrc file
var OFF = 0, WARN = 1, ERROR = 2;
module.exports = exports = {
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true
@kukiron
kukiron / travis-coveralls.md
Created October 15, 2017 14:12 — forked from tpai/travis-coveralls.md
Build Project with Travis-CI and Coveralls

Directory Structure

.
|-- dist/
|-- src/
|-- test/
|  `-- setup.jsx    # jsdom for renderIntoDocument()
|-- .babelrc
|-- .coveralls.yml
@kukiron
kukiron / GitHub with Operator Mono font for code.md
Created October 23, 2017 04:33 — forked from tdd/GitHub with Operator Mono font for code.md
Use Operator Mono Ssm font in GitHub code views (PRs, diffs, etc.)

So you love the Operator Mono font? I don't blame you! So do we! It's a bit pricey but worth every penny.

In fact, we're so used to it in our editors that we were a bit sad with GitHub's otherwise neat code views. When we review PRs in the web UI, we want our Operator Mono!

So, assuming you have it installed on your machine, you can put the JS bit in the other code snippet of this Gist in a bookmarklet, and click it when you're on a GitHub.com page you want to have switch over to our beloved font. We used the ScreenSmart variant here, which you get in the font package and have probably installed, as it's the more legible one on screens. Feel free to adjust the font name if needed.

@kukiron
kukiron / TestSetupExampleCRAEnzymeChaiMocka.md
Created November 2, 2017 03:51 — forked from busypeoples/TestSetupExampleCRAEnzymeChaiMocka.md
Mocha/Chai/Enyzme test setup with create-react-app

Basic setup for using Enzyme/Mocha/Chai with create-react-app

This is a temporary solution. Might change in the near future, this depends on how create-react-app will implement testing.

create-react-app quick-test-example

cd quick-test-example

npm run eject

This describes the common mistake with using closures in JavaScript.

A function defines a new environment

Consider:

function makeCounter()
{
  var obj = {counter: 0};