Skip to content

Instantly share code, notes, and snippets.

View himedlooff's full-sized avatar

Mike Morici himedlooff

View GitHub Profile
@himedlooff
himedlooff / clickFileViewedViaRegex.js
Created October 10, 2019 18:02
When you have a lot of files to mark as viewed and you don't want to click them all...
function clickFileViewedViaRegex(regex, markAsViewed = true) {
document.querySelectorAll('.file').forEach((item) => {
if (item.querySelector('.file-header a[title]').getAttribute('title').match(regex)) {
var checkbox = item.querySelector('.js-reviewed-checkbox');
if (markAsViewed && !checkbox.checked) checkbox.click();
if (!markAsViewed && checkbox.checked) checkbox.click();
}
});
}

List

git config --global -l

Recent

git config --global alias.recent 'for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"'

Show hidden files on OSX

defaults write com.apple.finder AppleShowAllFiles true
killall Finder
@himedlooff
himedlooff / prefixing-scss.md
Last active March 9, 2018 15:26
Regex for finding SCSS variables and class declarations and prepending them with a prefix in Sublime Text

SCSS

Field Value
Find \$([a-z\-_]+)
Where -*.js,-*.woff,-*.woff2
Replace $newprefix-$1

Should match these:

<html>
<head style="display: block; width: 50%; height: 100%; float: left;">
<meta charset="UTF-8">
<title>Live CSS</title>
<style>
* {
box-sizing: border-box;
}
#style {
@himedlooff
himedlooff / svg-regex.md
Last active February 27, 2018 20:15
SVG Regex
 id="[a-z(-|_)]*"
\n[\s]*
@himedlooff
himedlooff / github-copy-file-path.js
Last active October 21, 2015 22:14
Paste this into your console to enable click-to-copy on GitHub.com file paths
(function(){
$('.file-info[title], .file-info [title]')
.css('cursor', 'pointer')
.click(function() {
var range = document.createRange();
$(this).html($(this).attr('title'));
range.selectNode(this);
window.getSelection().addRange(range);
try {
var successful = document.execCommand('copy');
<?xml version="1.0" encoding="UTF-8"?>
<mxGraphModel dx="3239" dy="2042" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="826" style="default-style2" math="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="192" value="" style="edgeStyle=elbowEdgeStyle;entryX=0.5;entryY=0;exitX=0.5;exitY=1;strokeColor=#FFB366;elbow=vertical" parent="1" source="95" target="129" edge="1"><mxGeometry width="100" height="100" relative="1" as="geometry"><mxPoint x="-500" y="970" as="sourcePoint"/><mxPoint x="-400" y="870" as="targetPoint"/><Array as="points"><mxPoint x="-410" y="620"/></Array></mxGeometry></mxCell><mxCell id="176" value="" style="edgeStyle=none;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#FFB366" parent="1" source="152" target="108" edge="1"><mxGeometry width="100" height="100" relative="1" as="geometry"><mxPoint x="-420" y="-594.5" as="sourcePoint"/><mxPoint x="-420" y="-415.5" as="targetPoint"/></mxGeometry></mxCell><mxCell
var n = [
':namik_smile::namik_smile::namik_smile:',
':namik_smile::spacer::namik_smile:',
':namik_smile::spacer::namik_smile:',
];
var a = [
':namik_smile::namik_smile::namik_smile:',
':namik_smile::spacer::namik_smile:',
':namik_smile::namik_smile::namik_smile::namik_smile:',
];