Skip to content

Instantly share code, notes, and snippets.

View zumwalt's full-sized avatar

Casey Zumwalt zumwalt

View GitHub Profile
@kmelve
kmelve / BlockEditor.ts
Created May 24, 2024 11:10
Markdown to Portable Text paste handler
import { toPlainText } from "@portabletext/react"
import { BlockEditor as DefaultBlockEditor } from "sanity"
import { handlePaste } from "~/studio/components/blockEditor/handlePaste"
const wordsPerMinute = 200
export default function BlockEditor(props: any, ref) {
const value = props.value ?? []
const plainText = toPlainText(value)
const characterCount = plainText.length
#!/usr/bin/env bash
# Run this command to execute the script:
# curl https://gist.githubusercontent.com/daneden/c6b5cfbcff4d3cc3ca46/raw/smaller-sketch-svgs.sh | bash
# Tell Sketch to export compact SVGs
defaults write com.bohemiancoding.sketch3 svgExportCompact -bool yes
defaults write ~/Library/Preferences/com.bohemiancoding.sketch3.plist svgExportCompact -bool yes
# Tell Sketch to omit layer names as IDs for SVGs
defaults write com.bohemiancoding.sketch3 svgExportSkipAssignIdToLayerName -bool yes
@grantland
grantland / README.md
Last active April 12, 2025 02:09
NextBus API
@WattsInABox
WattsInABox / .gitignore
Last active July 5, 2024 09:36
Generate Static HTML Website Using Ruby on Rails
# Ignore static version of the site (used to upload error pages to S3 for Heroku errors)
/out
@tomsseisums
tomsseisums / jsbin.upUFIbO.css
Last active July 22, 2016 16:04
A very dirty extension for Highcharts, that makes the leftmost and rightmost points, areas extend to plot areas edges.
#chart
{
width: 90%;
margin: 0 auto;
min-height: 350px;
}
@mathiasbynens
mathiasbynens / toggleAttr() jQuery plugin
Created February 8, 2010 21:20
toggleAttr() jQuery plugin
/*!
* toggleAttr() jQuery plugin
* @link http://github.com/mathiasbynens/toggleAttr-jQuery-Plugin
* @description Used to toggle selected="selected", disabled="disabled", checked="checked" etc…
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
jQuery.fn.toggleAttr = function(attr) {
return this.each(function() {
var $this = $(this);
$this.attr(attr) ? $this.removeAttr(attr) : $this.attr(attr, attr);