Skip to content

Instantly share code, notes, and snippets.

output: {
jsonpFunction: 'CUSTOMwebpackJsonp'
},
@culttm
culttm / head is changed
Last active May 27, 2017 07:42
observeDOM.js
observeDOM(document.getElementsByTagName('head')[0], () => {
console.log('head is changed');
});
const arrayToObject = (array) =>
array.reduce((obj, item) => {
obj[item.id] = item
return obj
}, {})
@culttm
culttm / pagin.js
Created April 22, 2017 21:49
pagination script
module.exports = function (current, length, displayLength) {
if (length <= 1) return []
displayLength = displayLength - 2
var indexes = [1]
var start = Math.round(current - displayLength / 2)
var end = Math.round(current + displayLength / 2)
if (start <= 1) {
start = 2
end = start + displayLength - 1
if (end >= length - 1) end = length - 1
@culttm
culttm / .babelrc
Created April 20, 2017 07:33 — forked from thejmazz/.babelrc
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
One solution is
npm install --save-dev babel-plugin-transform-object-rest-spread
and than create a .babelrc file in your project directory
{
"plugins": ["transform-object-rest-spread"]
}
@culttm
culttm / Sublime Text 3 Build 3103 License Key - CRACK
Created March 15, 2017 06:17
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@culttm
culttm / Redux4Ways
Created February 25, 2017 10:40 — forked from adamTrz/Redux4Ways
//App.js:
...
connect(mapStateToProps, { fetchData })(App)
//ActionCreator:
export const fetchData = () => (dispatch) => {
dispatch({type: FETCHING_DATA})
getPeople()
.then(data => dispatch({type: FETCHING_DATA_SUCCESS, payload: data}))
.catch(er => dispatch({type: FETCHING_DATA_FAILURE}))
@culttm
culttm / introrx.md
Created February 24, 2017 18:23 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Шпаргалка по консольным командам Git

Общее

Git — система контроля версий (файлов). Что-то вроде возможности сохраняться в компьютерных играх (в Git эквивалент игрового сохранения — коммит).

Любой файл в папке существующего репозитория может находиться или не находиться под версионным контролем (отслеживаемые и неотслеживаемые).