Skip to content

Instantly share code, notes, and snippets.

@TimPetricola
TimPetricola / machine.js
Created January 14, 2021 10:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@TimPetricola
TimPetricola / cssstats.html
Created September 27, 2017 15:52
Drivy CSS stats 2017/09/27
<html><head>
<meta charset="utf-8">
<title>CSS Stats</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>body,button{margin:0}button,input,select{font-family:inherit;font-size:100%}svg{max-height:100%}body{font-family:'-apple-system',BlinkMacSystemFont,'Helvetica Neue',Helvetica,sans-serif;line-height:1.5;font-size:100%}h1,h2{font-family:'-apple-system',BlinkMacSystemFont,'Helvetica Neue',Helvetica,sans-serif;font-weight:700;line-height:1.25;margin-top:1em;margin-bottom:.5em}p,ul{font-size:1rem;margin-top:0;margin-bottom:1rem}ul{padding-left:2rem}pre{font-family:'Source Code Pro',Consolas,monospace;font-size:inherit;margin-top:0;margin-bottom:1rem;overflow-x:scroll}h1{font-size:2rem}.h2,h2{font-size:1.5rem}.h3{font-size:1.25rem}.h4{font-size:1rem}.h5{font-size:.875rem}.h6{font-size:.75rem}.list-reset{list-style:none;padding-left:0}input,select{margin-top:0;margin-bottom:.5rem}input[type=url]{box-sizing:border-box;height:2.25em;paddi
@TimPetricola
TimPetricola / image.rb
Created December 10, 2013 00:19
Carrierwave + S3 image processing
# Image model with ImageUploader mounted on image attribute
class Image < ActiveRecord::Base
mount_uploader :image, ImageUploader
def process_image!(versions = [])
return unless self.image.file.exists?
hosted_image.should_process = true
@TimPetricola
TimPetricola / .rdebugrc
Created April 8, 2013 23:15
ruby debugger config
set autolist
set autoeval
set autoreload
@TimPetricola
TimPetricola / 1-mixins.sass
Last active December 14, 2015 06:39
Keyframes mixin for SASS
=keyframes($name)
@-webkit-keyframes #{$name}
@content
@-moz-keyframes #{$name}
@content
@-ms-keyframes #{$name}
@content
@keyframes #{$name}
@content
@TimPetricola
TimPetricola / cracklepop.go
Created March 16, 2014 22:57
A simple CracklePop (FizzBuzz) program in Go
package main
import (
"fmt"
"strconv"
)
const crackle, pop = "Crackle", "Pop"
func CracklePop(i int) (res string) {