- Make a new Automator document of type "App"
- Add these three steps in order
- Remember to replace
mikker
with your own username in the AppleScript scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Do Not Track --> | |
<script type="text/javascript"> | |
// Global | |
window.trackingEnabled = function() { | |
var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack; | |
return !(dnt === "1" || dnt === "yes"); | |
}(); | |
</script> | |
<!-- Google Tag Manager, Segment, etc. --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hoverTime = 400 | |
const fetchers = {} | |
const doc = document.implementation.createHTMLDocument('prefetch') | |
function fetchPage (url, success) { | |
const xhr = new XMLHttpRequest() | |
xhr.open('GET', url) | |
xhr.setRequestHeader('VND.PREFETCH', 'true') | |
xhr.setRequestHeader('Accept', 'text/html') | |
xhr.onreadystatechange = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.extract_dominant_colors(image_path, quantity=5, threshold=0.01) | |
image = MiniMagick::Image.open(image_path) | |
# Get image histogram | |
result = image.run_command('convert', image_path, '-format', '%c', '-colors', quantity, '-depth', 8, 'histogram:info:') | |
# Extract colors and frequencies from result | |
frequencies = result.scan(/([0-9]+)\:/).flatten.map { |m| m.to_f } | |
hex_values = result.scan(/(\#[0-9ABCDEF]{6,8})/).flatten | |
total_frequencies = frequencies.reduce(:+).to_f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ENVs | |
# HEROKU_API_KEY | |
# HEROKU_APP_NAME | |
# Gemfile | |
# gem 'heroku-api' | |
# config/initializers/heroku.rb | |
unless (app_name = ENV["HEROKU_APP_NAME"]).nil? | |
require 'heroku-api' |
Uses d3-force
to disperse overlapping markers on a mapbox-gl
map.
Markers are tethered to their actual location, but have a collision force based on the radius of the icon. An additional force pulls icons towards their previous location (locations are calculated each time you move the map) to avoid markers jumping around excessively as they settle into different local minima on each re-draw.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener "trix-initialize", (e) => | |
Utility.TrixMentions.prepare($(e.target)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].slice.call(document.querySelectorAll('table tr td:nth-child(2)')).reduce((total, num) => { | |
let numValue = parseInt(num.innerHTML.replace('$', '')); | |
return total + numValue; | |
}, 0) + '$'; |
NewerOlder