Skip to content

Instantly share code, notes, and snippets.

View rdsaunders's full-sized avatar

Richard Saunders rdsaunders

View GitHub Profile

Specification for the Contensis Composer Format

WORKING DRAFT


Canvas/composer JSON structure

Each composer item in a composer/canvas is made up of a type a value array which contains fragments that can have their own properties and decorators.

@rdsaunders
rdsaunders / 44x44-cursor.js
Last active June 11, 2021 18:38
44x44px Cursor Bookmarklet
javascript:(function(){ var style = document.createElement(%27style%27), styleContent = document.createTextNode(%27* { cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJBJREFUeNrs2dEKgDAIhWEN3/+VLYtBF12MppHwDxY0uvg4DJpORcSl0bB4uPcwq+oFHu8/956pbtJsAAYMGDBgwIABA044t3pMEgb8VU2XsWdn1o/aUUn4bchPBWNFYWvVidxbCFGmr7YULBs1YDPfsYcXEi9ryvDjAAwYMGDAgAED7nK8bHG7qNLs6nYXYAAheh5j8Qw5fwAAAABJRU5ErkJggg==) 22 22, auto !important}%27); style.appendChild(styleContent ); var caput = document.getElementsByTagName(%27head%27); caput[0].appendChild(style); })();
@rdsaunders
rdsaunders / Shortcut.txt
Created November 16, 2019 07:11
Siri shortcut
#
## Setup
GitHub token
Repo name
Path for image upload
Path for markdown upload
Choose image
@rdsaunders
rdsaunders / pocket-bookmarks-to-markdown.py
Created October 1, 2019 07:51
A python script to convert a CSV file of saved bookmarks via pocket/google sheets and IFTTT into markdown for jekyll.
# Takes a file CSV file called "data.csv" and outputs each row as a YAML file named after first column.
# Data in the first row of the CSV is assumed to be the column heading.
# Original work borrowed from: https://github.com/hfionte/csv_to_yaml
# Import the python library for parsing CSV files.
import csv
from datetime import datetime
# Open our data file in read-mode.
csvfile = open('data.csv', 'r')
import codecs
from datetime import datetime
import json
import os
import posixpath
import re
import shutil
import sys
# This script will import your instagram photos to your static site. It should work for most, assuming you customize the POST_TEMPLATE to match what your site uses.
@rdsaunders
rdsaunders / glyphicons.ljmap
Last active December 9, 2015 15:24
An icon map to use with Icon Jar for the current version of the Glyphicons font (v1.8)
{
"icons":{
"e597":{
"name":"activity"
},
"e089":{
"name":"address-book"
},
"e092":{
"name":"adjust"
@rdsaunders
rdsaunders / compass-sprite-removehash.rb
Created January 19, 2015 12:35
Remove the random string in the sprite filename If you don’t want the random string that’s appended to the filename when a new sprite is created, here’s how to remove it. You will need to add this to config.rb inside your Compass project.
# Make a copy of sprites with a name that has no uniqueness of the hash.
on_sprite_saved do |filename|
if File.exists?(filename)
FileUtils.cp filename, filename.gsub(%r{-s[a-z0-9]{10}\.png$}, '.png')
# Note: Compass outputs both with and without random hash images.
# To not keep the one with hash, add: (Thanks to RaphaelDDL for this)
FileUtils.rm_rf(filename)
end
end
@rdsaunders
rdsaunders / compass-sprite-hashtoquerystring.rb
Created January 19, 2015 12:34
Remove the hash string in the sprite filename and replace with a query string
# Make a copy of sprites with a name that has no uniqueness of the hash.
on_sprite_saved do |filename|
if File.exists?(filename)
FileUtils.cp filename, filename.gsub(%r{-s[a-z0-9]{10}\.png$}, '.png')
# Note: Compass outputs both with and without random hash images.
# To not keep the one with hash, add: (Thanks to RaphaelDDL for this)
FileUtils.rm_rf(filename)
end
end
<select name="calendar-days">
<option value="Sunday">Sunday</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
<option value="Friday">Friday</option>
<option value="Saturday">Saturday</option>
</select>