Skip to content

Instantly share code, notes, and snippets.


Han apricot13

View GitHub Profile
apricot13 / highlight shorts + premiers + lives.js
Last active Mar 18, 2022
Highlight short videos on youtube (bookmarklet)
View highlight shorts + premiers + lives.js
javascript:const milliseconds=(e,t,r)=>1e3*(60*e*60+60*t+r),times=document.querySelectorAll("ytd-thumbnail-overlay-time-status-renderer");[...times].forEach(e=>{const t=e.querySelector("#text").innerHTML.trim().split(":");2===t.length&&t.unshift("0");const r=milliseconds(t[0],t[1],t[2]);r<=6e4&&(e.closest("ytd-grid-video-renderer").style.backgroundColor="#a57070"),isNaN(r)&&(e.closest("ytd-grid-video-renderer").style.backgroundColor="#6e6ebb")});
apricot13 / sortByActualPrice-bookmarklet.js
Last active Jan 4, 2022
Amazon wishlist Sort by Price Dropped By Bookmark (copy paste this entire thing into the URL part of a bookmark in chrome)
View sortByActualPrice-bookmarklet.js
javascript:const allItems=document.getElementById("g-items");"flex","column","column-reverse";const items=allItems.querySelectorAll("li"),prices=[];[...items].forEach(e=>{let t=e.getAttribute("data-price");e=e.getAttribute("data-itemid");t=isFinite(t)&&!isNaN(t)?t:0,prices.push([e,t])}),prices.sort((e,t)=>t[1]-e[1]),prices.forEach((e,t)=>{if(""!==e[0]){e='[data-itemid="'+e[0]+'"]';console.log(e);const l=document.querySelector(e);console.log(e,l),l&&(}});
View 01 - choose-image.html
<!-- Step 1 - we need people to be able to choose their image -->
<div class="test-image">
<input type="file" id="testImage" onchange="onFileSelected(event)" />
View gist:26d7142333c78cc4bdbe2e2da00c59cd
var s = [];
s.push("# " + jQuery(".board-header").children()[0].innerText);
jQuery(".list:has(.list-header-name)").each(function() {
s.push("\n## " + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n");
jQuery(this).find(".list-card").each(function() {
var lne = "* " + jQuery(this).find(".list-card-title")[0].innerText
View typeformbug.html
<!doctype html>
<html class="no-js" lang="en-gb">
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
View workflowy.css
#documentView {
font-family: Open Sans
.page {
width: 90% !important;
margin: 0px auto;
transform: none !important;
.name {
padding-bottom: 5px !important;
apricot13 /
Last active Aug 29, 2015
Applescript: Watch folder and update labels
-- I want edited folders to be red.
	property red : 2
    on adding folder items to this_folder after receiving added_items
              tell application "Finder"
          -- set label of the 'watched' folder to red
                   set label index of this_folder to red

-- for the items added

apricot13 / popup.html
Created May 9, 2015
Google Maps: popup map Uses fancybox (not fancybox 2)
View popup.html
<a id="popupmap" href="popuplocationmap.html"><img src="map.png" width="31" height="33" class="contactMap"/></a>
apricot13 / git_feature_branch
Created Jan 8, 2015
Git: Feature branch workflow
View git_feature_branch
git checkout -b feature-branch master
git status
git add <some-file>
git commit
git push -u origin feature-branch
git push
git checkout master
apricot13 /
Last active Jul 13, 2016
Nicely formatted git

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit


git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

And every time you need to see your log, just type in git lg