Skip to content

Instantly share code, notes, and snippets.

View Tauka's full-sized avatar
🎯
Focusing

Tauyekel Kunzhol Tauka

🎯
Focusing
  • Nazarbayev University
  • Astana, Kazakhstan
View GitHub Profile
@kana-sama
kana-sama / basket.js
Last active February 9, 2018 12:18
products-basket-selectors-example
// fake reselect
const createSelector = (deps, body) => (state, props) =>
body(...deps.map(dep => dep(state, props)));
const createStructuredSelector = scheme => (state, props) =>
Object.keys(scheme).reduce((result, key) => ({
...result,
[key]: scheme[key](state, props)
}), {});
@Luchanso
Luchanso / redux-act.js
Last active July 19, 2018 20:32
Сравнение redux-act и redux-actions
// Import functions
import { createStore } from 'redux';
import { createAction, createReducer } from 'redux-act';
// Create an action creator (description is optional)
const add = createAction('add some stuff');
const increment = createAction('increment the state');
const decrement = createAction('decrement the state');
// Create a reducer
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 9, 2025 19:51
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@hallettj
hallettj / global-variables-are-bad.js
Created February 14, 2009 21:15
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {