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 / 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 / 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 / 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 / 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 / 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 / cursor-resize-css
Created March 12, 2018 11:28 — forked from imarkdesigns/cursor-resize-css
Customize cursor resize for textarea
.resize { cursor: row-resize; }