This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# place in .bash_profile or .bashrc | |
# colors is here: https://misc.flogisoft.com/bash/tip_colors_and_formatting | |
PS1="\[\e]0;\u@\h: \w\a\]" | |
PS1="$PS1\[\033[38;5;22m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove VK ads | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Remove VK advertisement | |
// @author maxxx1313 | |
// @match https://vk.com/* | |
// @grant none | |
// @runat document-end | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch \ | |
--prune-empty -d /dev/shm/scratch \ | |
--index-filter "git rm -rf --cached --ignore-unmatch oops.iso" \ | |
--tag-name-filter cat \ | |
-- --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert'); | |
/** | |
* Parse string date representation into Date object | |
* input string - date in ISO format: | |
* * "2018-05-17T16:40:56" | |
* * "2018-05-17T16:40:56.303Z" | |
* * "2018-05-17T16:40:56.303+00:00" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.serializeObject = function() { | |
return this.serializeArray().reduce(function(result, item){ | |
result[item.name]=item.value; | |
return result; | |
}, {}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
/* global describe */ | |
/* global it */ | |
/* global require */ | |
/* jshint esversion: 6 */ | |
const assert = require('assert'); | |
/** | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add next line in ~/.gitconfig | |
[alias] | |
forward = !git tag _temp && git checkout $1 --quiet && git merge _temp --ff-only && git tag _temp -d && git status | |
mergeto = !bash -x -c 'ish=$(git status |grep -P \"(HEAD detached at|On branch)\" | grep -oP \"[^ ]+$\" ) && echo "$ish" && git checkout '"$1"' --quiet && git merge "$ish" --no-ff --no-edit && git status' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// custom middleware: use res.promise() to send promise response | |
app.use((req,res,next)=>{ | |
/* | |
Report error | |
You can use it in severqal ways: | |
- promise.catch() from promise | |
- res.error(new Error()) - pass any error object | |
- res.error({status:401, message:'alala'}) - pass any object | |
- res.error(401, 'alala') - pass code and message separately |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"header": { | |
"number": { | |
"low": 0, | |
"high": 0, | |
"unsigned": true | |
}, | |
"previous_hash": "", | |
"data_hash": "223e57f14464047011a96d77eea75aa0296b25a10d50cdecf217948513644124" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Object.assign) { | |
Object.assign = | |
function (target) { | |
var from, to = Object(target), symbols; | |
for (var s = 1; s < arguments.length; s++) { | |
from = Object(arguments[s]); | |
for (var key in from) { | |
if (Object.prototype.hasOwnProperty.call(from, key)) { | |
to[key] = from[key]; | |
} |