Skip to content

Instantly share code, notes, and snippets.

@plugn
plugn / git-branch-commits-diff.sh
Created December 16, 2019 21:07
git commit diff between branches
# List commits on DEV-01 branch but not on stable
git log --oneline --no-merges DEV-01 ^stable
# https://stackoverflow.com/questions/1710894/using-git-show-all-commits-that-are-in-one-branch-but-not-the-others
# To see a list of which commits are on one branch but not another, use git log:
# git log --no-merges oldbranch ^newbranch
#...that is, show commit logs for all commits on oldbranch that are not on newbranch. You can list multiple branches to include and exclude, e.g.
# git log --no-merges oldbranch1 oldbranch2 ^newbranch1 ^newbranch2
@plugn
plugn / README.md
Created December 2, 2019 10:49 — forked from miku/README.md
git --track vs --set-upstream vs --set-upstream-to

README

Short excursion into git --track, --set-upstream and --set-upstream-to.

All examples use the aliases co for checkout and br for branch.

Setup:

$ git clone [email protected]:AKSW/OntoWiki.git

@plugn
plugn / GitCommitEmoji.md
Created November 14, 2019 10:13 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
// JIRA LINKED TASKS UTILITY
const getLinked = () => Array.from($$('.link-content'))
const getTitle = (block, taskPrefix='RAIS') => ($$('span[title^=' + taskPrefix +']', block)[0] || {}).title
const getStatus = block => ($$('li.status span', block)[0] || {}).textContent
const getPriority = block => ($$('li.priority img', block)[0] || {}).title
const getLinkedTasks = () => (
getLinked().map(block => ({
title: getTitle(block),
status: getStatus(block),
@plugn
plugn / jxt.js
Last active October 30, 2019 07:48
XML/JSON/DOM Template Engine
/**
* @title XML/JSON/DOM Template Engine
* @author Max L Dolgov, bananafishbone at gmail dot com
* @copyright Max L Dolgov
**/
(function($){
var jxt = {
xmlNS : {
@plugn
plugn / svg-scale.js
Last active September 20, 2019 08:20
#!/usr/bin/env node
/**
* @author Max L Dolgov <[email protected]>
* @description Utility open SVG files
* scales them to given ICON_HEIGHT with respect to ratio then put to destination directory
*/
// Load in dependencies
var util = require('util');
var fs = require('fs');
@plugn
plugn / xhr.js
Last active November 6, 2024 22:23
xhr.js
import { parseHttpHeaders, getCookie } from './http'
/**
* HTTP Request wrapper
* @author Max L Dolgov <[email protected]>
*
* @description created to eliminate CORS preflighted requests
* @param url {string}
* @param data {object}
@plugn
plugn / http.js
Last active August 4, 2019 12:31
/**
*
* @description parses http headers string
* and returns them as Array of { key: value }
*
* @headers {string}
* var headers = `Pragma: no-cache
* Cache-Control: no-cache
* Content-Type: application/json; charset=UTF-8
* Accept-Encoding: gzip, deflate, br
const exports = {
aerialway: {
fields: ["aerialway"],
geometry: ["point", "vertex", "line"],
tags: {
aerialway: "*"
},
terms: ["ski lift", "funifor", "funitel"],
searchable: !1,
name: "Aerialway"
function reduceObject( obj, reduceCallback, initialValue ) {
return Object.keys( obj ).reduce( function( acc, key, idx, arr ) {
return reduceCallback( acc, obj[key], key, obj )
}, initialValue )
}
var mapCollectionByProp = (list, fieldName) => list.reduce( (acc, v) => ({ ...acc, [v[fieldName]]: v }), {})
/**
* returns new object with result of iterator() call for each property from keys