Skip to content

Instantly share code, notes, and snippets.

View mbIkola's full-sized avatar
🦍
return code || die;

Nickolay Kharchevin mbIkola

🦍
return code || die;
View GitHub Profile
more_set_headers "Access-Control-Allow-Origin: $http_origin" ;
more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE, HEAD' ;
more_set_headers 'Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,If-Match,If-None-Match,If-Modified-Since,If-Unmodified-Since,Cache-Control,Content-Type,X-Requested-With,Origin,Session-Token,Authorization';
more_set_headers 'Access-Control-Max-Age: 1728000' ;
more_set_headers 'Access-Control-Allow-Credentials: true' ;
more_set_headers 'Vary: Origin';
proxy_hide_header 'Access-Control-Allow-Origin';
proxy_hide_header 'Access-Control-Allow-Methods';
proxy_hide_header 'Access-Control-Allow-Headers';
var sas=sas||{};sas.utils=sas.utils||{};sas.events=sas.events||{};sas.rev=sas.rev||20110214;(function(){if(!sas.utils.cdns){sas.utils.cdns={"http:":"http://ak-ns.sascdn.com","https:":"https://ec-ns.sascdn.com"}}else{if(!sas.utils.cdns["http:"]||sas.utils.cdns["http:"].length==0){sas.utils.cdns["http:"]="http://ak-ns.sascdn.com"}if(!sas.utils.cdns["https:"]||sas.utils.cdns["https:"].length==0){sas.utils.cdns["https:"]="https://ec-ns.sascdn.com"}}var e=function(){};sas.utils.getIEVersion=function(){var g=navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);return g?parseInt(g[1]):undefined};sas.events.addEvent=function(h,g,i){if(!h||!g||!i){return}if(h.attachEvent){h.attachEvent("on"+g,i)}else{if(h.addEventListener){h.addEventListener(g,i,false)}}return{removeEvent:function(){if(h.detachEvent){h.detachEvent("on"+g,i)}else{if(h.removeEventListener){h.removeEventListener(g,i,false)}}}}};sas.events.addLoadEvent=function(h,l){if(!h||!l){return}var g="load";var i=function(){return true};var k=sas.utils.getIE
@mbIkola
mbIkola / postpublish.js
Created March 15, 2018 23:15
next iteration of prepublish.js from https://gist.github.com/mbIkola/53e902e30663a5ae6a8800f94fd505d1 : increment minor version. Add -SNAPSHOT, push.
const { execSync } = require('child_process');
const fs = require('fs');
const d = process.cwd();
let pkgInfo = require(d + '/package.json');
let ver = pkgInfo.version;
ver = ver.split('.');
let minor = ver.pop()*1 + 1;
@mbIkola
mbIkola / prepublish.js
Last active March 15, 2018 23:11
get version from package.json. Remove -SNAPSHOT from version. git tag it, commit + push. Usage: curl -s {url} | env node
const { execSync } = require('child_process');
const fs = require('fs');
const d = process.cwd(); //__dirname;
let pkgInfo = require(d + '/package.json');
let ver = pkgInfo.version;
if ( ! ver.match(/-SNAPSHOT$/) ) {
throw new Error("You can't publish non-snapshot version. Sorry");
}
#!/bin/bash
NPM_TOKEN="${1}"
imageName="${2}"
containerName="${3}"
docker build --build-arg NPM_TOKEN=${NPM_TOKEN} -t ${imageName} --label ${containerName} .
docker run --rm -t -i --entrypoint "/usr/bin/npm publish" ${imageName}
var BusRoutesCollection = (function() {
var _data = null, dbversion=4;
return function BusRoutesCollection(dataAvailable) {
dataAvailable =(function(orig) {
return function(a,b,c,d,e,f,g) {
setTimeout( function() {
orig.apply(null, [ a,b,c,d,e,f,g]);
}, 0);