Skip to content

Instantly share code, notes, and snippets.

View everm1nd's full-sized avatar

Nikita Simakov everm1nd

  • Berlin
View GitHub Profile
@everm1nd
everm1nd / chrome.sh
Created February 17, 2022 12:40
Run Chrome in CORS-disabled mode
open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security
@everm1nd
everm1nd / date.sh
Created May 6, 2020 15:04
Print UTC date in shell logs
echo $(date +'[%F %T %Z]')
@everm1nd
everm1nd / pre-request.js
Last active October 24, 2019 13:49
postman-wsse-pre-request.js
// set `wsse-user` and `wsse-secret` variables in
// your Postman environment
const user = pm.environment.get("wsse-user");
const secret = pm.environment.get("wsse-secret");
const header = getWsseHeader(user, secret);
pm.environment.set("wsse-header", header);
function sha1hex(str) {
@everm1nd
everm1nd / time.js
Last active November 7, 2018 16:41
[WIP] Simple Time Difference Kata done by students: https://www.codewars.com/kata/simple-time-difference/train/javascript
// https://www.codewars.com/kata/simple-time-difference/train/javascript
function solve(arr){
return arr.map(convertTimeToMinutes).sort((a, b) => a - b);
// const day = convertTimeToMinutes('24:00')
// const firstTime = convertTimeToMinutes(arr[0])
// const nextDayTime = firstTime + day
// return convertMinutesToTime(nextDayTime - firstTime - 1)
}
@everm1nd
everm1nd / swagger.yml
Last active April 11, 2018 16:57
APIGateway configuration for AJAX-endpoint
swagger: '2.0'
info:
title: HTTP-proxy API
description: Example HTTP-proxy API
version: '1.0.0'
schemes:
- https
produces:
- application/json
paths:
@everm1nd
everm1nd / tag-release.sh
Created March 22, 2018 11:08
Tag New Package Release on Travis Build
#!/bin/bash
# This script will create a git-tag if version in package.json changes
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
VERSION=$(node -pe "require('./package.json').version")
export PACKAGE_VERSION="v${VERSION}"
export LAST_TAG=$(git tag --sort version:refname | tail -1)
@everm1nd
everm1nd / sed-replace.sh
Created March 7, 2018 17:57
sed-replace
echo '{something+}' | sed -E 's/\{([A-Za-z0-9\-]+)\+\}/{\1}/'
sed -i '' 's/replace_this/with_that/g' file
@everm1nd
everm1nd / tryUndefined.js
Created December 28, 2017 16:12
Javascript Try Value of undefined
(object && object.key)
# this works, because `proc === x` is same as `proc.call(x)`
# weird syntactic choice makes a great job in case statements
def say_something_about(number)
greater_then_10 = -> (number) { number > 10 }
equals_15 = -> (number) { number === 15 }
case number
when greater_then_10
puts "it's greater then 10!"