Skip to content

Instantly share code, notes, and snippets.

View apricot13's full-sized avatar

Han apricot13

View GitHub Profile
@apricot13
apricot13 / folderHasNewContent.scpt
Created March 28, 2013 13:48
An applescript to monitor a folder and add a red label to any new files/folders added.
-- I want edited folders to be red.
property red : 2
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
@apricot13
apricot13 / UserScript: Quick link to Flickr Url and HTML code for images.js
Last active December 21, 2015 16:39
I've always preferred sourcing my (as in my own) blog post images from the flickr website rather than use a plugin. This is a very basic user script that puts the url of the image you want in the image thumbnail as your browsing the site, it makes it much quicker to open them all in new tabs then copy them over to your blog post.
@apricot13
apricot13 / Nicely-formatted-git.md
Last active July 13, 2016 19:31
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

alias

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

@apricot13
apricot13 / git_feature_branch
Created January 8, 2015 12:33
Git: Feature branch workflow
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
apricot13 / popup.html
Created May 9, 2015 11:35
Google Maps: popup map Uses fancybox http://fancybox.net/ (not fancybox 2)
<a id="popupmap" href="popuplocationmap.html"><img src="map.png" width="31" height="33" class="contactMap"/></a>
@apricot13
apricot13 / folderwatch.md
Last active August 29, 2015 14:20
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
         try
              tell application "Finder"
          -- set label of the 'watched' folder to red
                   set label index of this_folder to red

-- for the items added

#documentView {
font-family: Open Sans
}
.page {
width: 90% !important;
margin: 0px auto;
transform: none !important;
}
.name {
padding-bottom: 5px !important;
<!doctype html>
<html class="no-js" lang="en-gb">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</script>
@apricot13
apricot13 / gist:26d7142333c78cc4bdbe2e2da00c59cd
Created August 24, 2020 15:41
Copy trello board as markdown
http://www.secretgeek.net/trello_ws
```js
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
<!-- Step 1 - we need people to be able to choose their image -->
<div class="test-image">
<input type="file" id="testImage" onchange="onFileSelected(event)" />
</div>