Skip to content

Instantly share code, notes, and snippets.

@plugn
plugn / jenkins-api.md
Created February 4, 2020 10:03 — forked from justlaputa/jenkins-api.md
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

@plugn
plugn / index.md
Created January 28, 2020 06:07 — forked from ericandrewlewis/index.md
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@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 git@github.com:AKSW/OntoWiki.git

@plugn
plugn / GitCommitEmoji.md
Created November 14, 2019 10:13 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@plugn
plugn / js-oneliner.js
Created March 21, 2019 20:25 — forked from hk-skit/js-oneliner.js
Useful Array One-liners.
// Remove Duplicates from an array
const removeDuplicates =
arr => arr.filter((item, index) => index === arr.indexOf(item));
const removeDuplicates1 = array => [...new Set(array)];
const removeDuplicates2 = array => Array.from(new Set(array));
// Flattens an array(doesn't flatten deeply).
@plugn
plugn / .gitconfig
Created January 28, 2019 18:16 — forked from johnpolacek/.gitconfig
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
dmerged = "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
st = status
@plugn
plugn / what-forces-layout.md
Created December 12, 2018 12:14 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@plugn
plugn / parse-json.js
Created February 22, 2018 12:41 — forked from pbakondy/parse-json.js
Parse JSON, strip BOM
// https://github.com/npm/npm/blob/master/lib/utils/parse-json.js
'use strict'
var parseJSON = module.exports = function (content) {
return JSON.parse(stripBOM(content))
}
parseJSON.noExceptions = function (content) {
try {
@plugn
plugn / index.js
Created September 20, 2017 10:15 — forked from shospodarets/Chrome headless Puppeteer- capture DOM element screenshot using
Capture DOM element screenshot using Chrome headless
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
.wrapper{
width: 550px;
text-align: justify;
background: firebrick;
font-size: 0;
font-size: 12px\9; /* IE6-9 only hack */
}
.wrapper div{
background: white;