Skip to content

Instantly share code, notes, and snippets.

@lionelhorn
lionelhorn / github-export-labels.js
Last active July 23, 2020 00:08 — forked from douglascayers/github-export-labels.js
Export and import GitHub labels between projects by running JavaScript in the browser console to automate clicks.
/**
* Inspired by @MoOx original script: https://gist.github.com/MoOx/93c2853fee760f42d97f
* Adds file download per @micalevisk https://gist.github.com/MoOx/93c2853fee760f42d97f#gistcomment-2660220
* Tweaked from @douglascayers https://gist.github.com/douglascayers/d47e525dbd1e7149bafa65939f350baf
*
* Changes include:
* - Get the description from the `title` attribute instead of `aria-label` (doesn't exist anymore)
* - Use style.backgroundColor and parse the rgb(...) to hex (rather than regex parsing of 'style' string)
* - Downloads labels to a JSON file named after the webpage to know which GitHub repo they came from.
*
@Drofseh
Drofseh / rateOfFireTest.sqf
Last active November 15, 2020 04:00
Rate of fire test script
test_shotTimeArray = [];
test_totalShots = 0;
test_totalShotTime = 0;
test_averageShotTime = 0;
test_averageRPM = 0;
test_previousFireTime = diag_tickTime;
player addEventHandler [
"Fired",
{
@Isaddo
Isaddo / import-github-labels.js
Last active February 9, 2024 22:44
import github labels via console command
/*
Go on your labels page (https://github.com/user/repo/labels)
Edit the following label array
or
Use this snippet to export github labels (https://gist.github.com/MoOx/93c2853fee760f42d97f)
and replace it
Paste this script in your console
Press Enter!!
@MoOx
MoOx / index.js
Last active February 9, 2024 22:44
Export/import github labels
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),