For ease of maintainability this project has moved from this gist to its own repository. You can go and visit it there.
import SwiftUI | |
protocol TabSelectable { | |
associatedtype Tab | |
func shouldSelect(_ tab: Tab) -> Bool | |
} | |
@propertyWrapper | |
struct TabSelection<Value: Hashable> { | |
const { buildClientSchema, printSchema } = require("graphql"); | |
const fs = require("fs"); | |
const { PrismicLink } = require('apollo-link-prismic'); | |
const { gql, ApolloClient, InMemoryCache } = require("apollo-boost"); | |
const prismicReposistory = "<prismic.io repository name>" | |
const accessToken = "<access token from the repo API settings page" | |
const ouputFile = "./prismic.graphql" |
# use ImageMagick convert | |
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:
New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)
I had a client who I built a site for (ecommerce) that had a lot of high resolution images. (running about 500gb/mo). Cloudinary charges $500/mo for this usage and Amazon charges about $40. I wrote some middleware that I used to wrap my cloudinary urls with in order to enable caching. This is entirely transparent and still enables you to use all the cool cloudinary effect and resizing functions. Hopefully this is useful to someone!
I think using deasync()
here is janky but I couldn't think of another way to do it that allowed for quite as easy a fix.
/** @jsx React.DOM */ | |
'use strict'; | |
var React = require('react'); | |
## Will replace dashes in names with camelCase | |
#set($componentName = "") | |
#foreach($str in $NAME.split("-")) | |
#set($str = $str.substring(0,1).toUpperCase()+$str.substring(1)) |
##Setup your server (this would ideally be done with automated provisioning)
- add a deploy user with password-less ssh see this gist
- install forever
npm install -g forever
##Install flightplan
npm install -g flightplan
- in your project folder
npm install flightplan --save-dev
- create a flightplan.js file
let healthStore = HKHealthStore() |
Visit the new improved script here! Smooth scroll to top of page (Improved!)
If you need a plain JavaScript function to add a smooth scrolling back to the top of the page, you can use this script.
- Add an id of "top" to the
<body>
tag. Like this:<body id="top">
- Add the
onclick
function to the link. Like this:<a href="#top" onclick="scrollToTop(); return false">Back to Top ↑</a>