Skip to content

Instantly share code, notes, and snippets.

View neyasbltb88's full-sized avatar
🥉
Javascript developer

Denis Mashkov neyasbltb88

🥉
Javascript developer
View GitHub Profile
@neyasbltb88
neyasbltb88 / cursor-resize-css
Created March 12, 2018 11:28 — forked from imarkdesigns/cursor-resize-css
Customize cursor resize for textarea
.resize { cursor: row-resize; }
@neyasbltb88
neyasbltb88 / parseheaders.js
Created March 18, 2018 19:06 — forked from mmazer/parseheaders.js
JavaScript - parse XmlHttpRequest.getAllResponseHeaders into a key value pair.
/**
* XmlHttpRequest's getAllResponseHeaders() method returns a string of response
* headers according to the format described here:
* http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method
* This method parses that string into a user-friendly key/value pair object.
*/
function parseResponseHeaders(headerStr) {
var headers = {};
if (!headerStr) {
return headers;
@neyasbltb88
neyasbltb88 / HTTP Cookie header parser
Created March 21, 2018 19:24 — forked from pokeb/HTTP Cookie header parser
Quick and dirty HTTP cookie header parser in PHP
@neyasbltb88
neyasbltb88 / camelToKebab.js
Created January 9, 2019 09:34 — forked from nblackburn/camelToKebab.js
Convert a string from camel case to kebab case.
module.exports = (string) => {
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
};
@neyasbltb88
neyasbltb88 / httpRequest.js
Created January 12, 2019 12:23 — forked from MrSwitch/httpRequest.js
httpRequest, quick and easy
//
// httpRequest
// Make Cross Origin http requests for JSON data.
// The first path is url, the second is a callback, as a JSON object.
// If XHR CORS is not supported then JSONP is used. "&callback=" is appended to the request URL.
// @author Andrew Dodson
function httpRequest(url,callback){
// IE10, FF, Chrome
if('withCredentials' in new XMLHttpRequest()){
@neyasbltb88
neyasbltb88 / index.js
Created February 9, 2019 22:54 — forked from just-boris/index.js
Gulp wrap pipe
/**
* Wrap gulp streams into fail-safe function for better error reporting
* Usage:
* gulp.task('less', wrapPipe(function(success, error) {
* return gulp.src('less/*.less')
* .pipe(less().on('error', error))
* .pipe(gulp.dest('app/css'));
* }));
*/
@neyasbltb88
neyasbltb88 / gulpfile.js
Created February 26, 2019 11:46 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@neyasbltb88
neyasbltb88 / concat.array.buffers.js
Created March 24, 2019 01:37 — forked from 72lions/concat.array.buffers.js
Concatenates two ArrayBuffers
/**
* Creates a new Uint8Array based on two different ArrayBuffers
*
* @private
* @param {ArrayBuffers} buffer1 The first buffer.
* @param {ArrayBuffers} buffer2 The second buffer.
* @return {ArrayBuffers} The new ArrayBuffer created out of the two.
*/
var _appendBuffer = function(buffer1, buffer2) {
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
@neyasbltb88
neyasbltb88 / russia
Created April 3, 2019 18:40 — forked from gorborukov/russia
Регионы и города россии в формате JSON
[
{
"region": "Москва и Московская обл.",
"city": "Москва"
},
{
"region": "Москва и Московская обл.",
"city": "Абрамцево"
},
@neyasbltb88
neyasbltb88 / baseConverter.js
Created April 5, 2019 12:51 — forked from faisalman/baseConverter.js
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <[email protected]>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){