Skip to content

Instantly share code, notes, and snippets.

View tscanlin's full-sized avatar

Tim Scanlin tscanlin

View GitHub Profile
@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active January 23, 2025 22:45
Bookmarklet that lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(t){if(t){var e=window.open("","_blank","width=800,height=600");e.document.open(),e.document.write(t),e.document.close()}else alert("Clipboard is empty. Please copy some text to the clipboard first.")}).catch(function(t){console.error("Failed to read clipboard contents: ",t),alert("An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.")})}catch(t){console.error("An error occurred:",t),alert("An error occurred while trying to open the new window with the clipboard content.")}})();//bookmarklet_title: HTML Preview from Clipboard
@pizzarob
pizzarob / 01_DropZone.jsx
Last active July 12, 2024 07:05
HTML5 Drag and Drop File Upload React Component
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
const ANIMATION_DURATION = 1000;
class BatchDropZone extends React.Component {
static propTypes = {
@JuggoPop
JuggoPop / Git branch bash autocomplete *with aliases*
Created April 15, 2014 06:23
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases
@ifandelse
ifandelse / umd.js
Last active December 11, 2015 14:59
UMD boilerplate to handle AMD, Commonjs, and standard browser js
// Example UMD wrapper for a module that takes dependencies on underscore and postal.js
(function ( root, factory ) {
if ( typeof module === "object" && module.exports ) {
// Node, or CommonJS-Like environments
// Intentionally returning a factory method
module.exports = function( _, postal ) {
return factory( _, postal );
}
} else if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.