Skip to content

Instantly share code, notes, and snippets.

View pketh's full-sized avatar
🐢
https://kinopio.club

Pirijan pketh

🐢
https://kinopio.club
View GitHub Profile
@pketh
pketh / meta-seo.jade
Last active February 25, 2024 21:43
seo meta tags for social unfurling
// facebook open graph tags
meta(property="og:type" content="website")
meta(property="og:url" content=url)
meta(property="og:title" content=title)
meta(property="og:description" content=description)
meta(property="og:image" content=frog2x)
// twitter card tags (stack with og: tags)
meta(name="twitter:card" content="summary")
meta(name="twitter:site" content="@pketh")
@pketh
pketh / jiggle.styl
Created March 15, 2016 15:42
jiggle animation css
.jiggle
animation: jiggle 0.25s 1 ease-out forwards
@keyframes jiggle
0%
transform: rotate(-3deg)
33%
transform: rotate(3deg)
66%
transform: rotate(-3deg)
@pketh
pketh / names.js
Last active August 8, 2019 20:45
hw name maker
// Project Generator creates a random name for a users it forms the name from a random combination of
// An Adjective and Noun
const adjectives = ["pink", "carnelian", "orange", "yellow", "ivory", "cream", "green", "viridian", "aquamarine", "cyan", "blue", "cerulean", "azure", "indigo", "navy", "violet", "purple", "lavender", "magenta", "rainbow", "iridescent", "spectrum", "prism", "bold", "vivid", "pale", "clear", "glass", "translucent", "misty", "dark", "light", "gold", "silver", "copper", "bronze", "steel", "iron", "brass", "mercury", "zinc", "chrome", "platinum", "titanium", "nickel", "lead", "pewter", "rust", "metal", "stone", "quartz", "granite", "marble", "alabaster", "agate", "pebble", "pyrite", "crystal", "geode", "obsidian", "mica", "flint", "sand", "gravel", "boulder", "basalt", "ruby", "beryl", "scarlet", "citrine", "sulpher", "topaz", "amber", "emerald", "malachite", "jade", "abalone", "lapis", "sapphire", "diamond", "peridot", "gem", "jewel", "bevel", "coral", "jet", "ebony", "wood", "tree", "c
___ ___ ___
{o,o} {o.o} {o,o}
|)__) |)_(| (__(|
--"-"-----"-"------"-"--
O RLY? YA RLY NO WAI!
@pketh
pketh / conditional evaluation.coffee
Created December 3, 2015 19:01
tests multiple items to see if that item should be excluded
dothis = ->
console.log 'do this'
dothistoo = ->
console.log 'do this too'
dox = ->
console.log 'do x'
text = (x) ->
@pketh
pketh / color-cycling.coffee
Last active July 9, 2018 00:04
smooth color cycling backgrounds
target = $('body')
# get random RGB values so we can change background and link colors
r = Math.floor Math.random() * 241
g = Math.floor Math.random() * 241
b = Math.floor Math.random() * 241
# variables to hold the lighter shade RGB values
# rp1; gp1; bp1; rp2; gp2; bp2; rp3; gp3; bp3
@pketh
pketh / bouncy.coffee
Created December 1, 2015 00:32
bouncy links (adapted from shauninman.com/pendium)
# bouncy links
$('a').each ->
$(this).mousemove (e) ->
if this.isAlreadyAnimating
console.log 'still animating: ', this.isAlreadyAnimating
else
baseExpX = 4 # 2 ^ 4 == 16
baseExpY = 2 # 2 ^ 4 == 16
@pketh
pketh / git-recent.sh
Created September 28, 2015 19:42
List my recent git branches
# add this line to your .bash-profile (.bashrc should also work)
# call this in a repo folder with `git-recent`
alias git-recent="git for-each-ref --count=5 --sort=-committerdate refs/heads/ --format='🌺 %(refname:short)'"
@pketh
pketh / server.rb
Last active August 29, 2015 14:19 — forked from clody69/server.rb
require 'sinatra'
require 'haml'
$users = {'john' => {:roles => [:user] }, 'mike' => {:roles => [:user, :admin] } }
$tokens = {'123' => {:username => 'john', :expires_at => Time.now+60}}
helpers do
def authenticate_user!
@auth_token = auth_token
if $tokens.has_key?(@auth_token) && !$tokens[@auth_token][:expires_at].nil? && $tokens[@auth_token][:expires_at] > Time.now
@pketh
pketh / emails.coffee
Last active August 29, 2015 14:18
validates emails with hooks for doing other things
validateEmail = (email, input) ->
emailPattern = /^[A-Za-z0-9](([_\.\-+]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/i
if emailPattern.test(email)
addSuccessCookie()
return true
else
input.addClass('fail')
return false
addSuccessCookie = () ->