Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / utmstrip.user.js
Last active September 17, 2024 11:03
userscript: Drop the UTM params from a URL when the page loads
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.2
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http*://*
// ==/UserScript==
@mhawksey
mhawksey / gist:1276293
Last active October 23, 2023 09:00
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@devinrhode2
devinrhode2 / clean-scrollbar.css
Created May 2, 2012 03:42
Like, basically PERFECT scrollbars
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
@visnup
visnup / lock.css
Created May 5, 2012 20:31
"lock" orientation of a website for mobile (iPad, iPhone)
/* if portrait mode is detected, rotate the entire site -90 degrees to hint rotating to landscape */
@media (orientation: portrait) {
body {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
}
/* This function extracts user input from the Loan Calculator input form and uses it to set the variables of loanAmount, repayPeriod and protection*/
function getInput()
{
document.getElementById('error').style.display = 'none';
var loanAmount = document.getElementById('loan_amount').value;
/*Check whether user input for loan amount is valid*/
if (isNaN(loanAmount) == true || loanAmount<1000 || loanAmount>500000)
{
@codesoda
codesoda / select_other.html
Created September 28, 2012 10:44
show/hide text box based on selected drop down
<!--
the select needs
- "has_other" css class
- "data-other" attribute, which points to the id of the element to hide/show (normally a textbox)
- "data-other-text" attribute, which indicates the text which indicates that other has been selected
-->
<select class="has_other" data-other="#textbox_id" data-other-text="...other">
<option>option 1</option>
<option>...other</option>
@iso100
iso100 / related_entries.html
Created October 9, 2012 01:06
Related entries in Statamic via taxonomy tags
@ziadoz
ziadoz / stripe-checkout.html
Last active November 19, 2022 05:59
Custom Stripe Checkout Button
<form action="." method="post">
<noscript>You must <a href="http://www.enable-javascript.com" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript>
<input
type="submit"
value="Pay with Card"
data-key="PUBLISHABLE STRIPE KEY"
data-amount="500"
data-currency="cad"
data-name="Example Company Inc"
@dideler
dideler / example.md
Last active November 14, 2024 03:33
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.
@opattison
opattison / jekyll-css-yaml-colors.css
Created August 28, 2013 01:11
How to use YAML front matter variables in a CSS file to define colors using variables in Jekyll, using Liquid tags. This example uses HSL colors with hex fallback colors. The goal here is to create standardized CSS with a color palette that can easily be extended to a whole file and maintained easily with only a few variables. The same thing cou…
---
white:
hsl: 'hsla(138, 10%, 98%, 1)'
hex: '#f9fafa'
black:
hsl: 'hsla(138, 16%, 10%, 1)'
hex: '#151e18'
green:
hsl: 'hsla(138, 39%, 54%, 1)'
hex: '#5cb777'