Skip to content

Instantly share code, notes, and snippets.

View okj579's full-sized avatar

Owen Kieffer-Jones okj579

View GitHub Profile
@froxxxy
froxxxy / tampermonkey.partyparrot.js
Last active August 27, 2020 05:40
Tampermonkey userscript to get the party started with some parrots on any website! ;)
// ==UserScript==
// @name party parrot - PARTY OR DIE
// @namespace https://github.com/jmhobbs/cultofthepartyparrot.com
// @version 0.1
// @description There's no parrot like party parrot!
// @author You
// @match http://*/*
// @match https://*/*
// @grant GM_addStyle
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
@B-iggy
B-iggy / inline-svg-function.scss
Last active December 13, 2020 11:53
Inline SVG function [SASS]
// set svg d path used as fallback (star)
$svg-d-path: 'm25,1l6,17l18,0l-14,11l5,17l-15,-10l-15,10l5,-17l-14,-11l18,0l6,-17z' !default;
// functions to urlencode the svg string
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
@ksafranski
ksafranski / SimpleStore.js
Last active July 2, 2022 15:25
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@tregusti
tregusti / webkit-pseudo-elements.md
Created November 10, 2012 22:55 — forked from leostratus/webkit-pseudo-elements.md
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];