Skip to content

Instantly share code, notes, and snippets.

View adamcbrewer's full-sized avatar

Adam Brewer adamcbrewer

View GitHub Profile
@adamcbrewer
adamcbrewer / hd-media-query.css
Created January 18, 2014 15:34
CSS: HD Media Query Snippet
@media (-webkit-min-device-pixel-ratio: 2),
(min--moz-min-device-pixel-ratio: 2),
(min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
.logo {
background-image: url(../img/[email protected]);
}
}
@adamcbrewer
adamcbrewer / sortBy.onEdit.gs
Created February 1, 2014 14:43
GS: Automatically sorts the 1st column (not the header row) Ascending.
/**
* Automatically sorts the 1st column (not the header row) Ascending.
*/
function onEdit(event){
var sheet = event.source.getActiveSheet();
var editedCell = sheet.getActiveCell();
var columnToSortBy = 1;
var tableRange = "A4:Z99"; // What to sort.
@adamcbrewer
adamcbrewer / typo-transforms.css
Created May 22, 2014 09:19
CSS: Fixing Typography Inside of CSS 2D Transforms
/* This should hopefully fix crappy typography inside of rotated elements.
Taken from http://flippinawesome.org/2014/05/21/fixing-typography-inside-of-css-2-d-transforms/ */
.rotated-typography {
transform: perspective(1px) rotate(-10deg);
/* Using `translateZ(0)` forces GPU rendering (and only fixes -webkit), but `perspective(1px)` does the job nicely. */
/* Don't use -ms prefix, however, as Presto engine in IE9 lacks 3D transform support. */
}
@adamcbrewer
adamcbrewer / share-intents.md
Last active November 9, 2017 07:14
SOCIAL: Share intents on major platforms

Twitter

<a href="http://twitter.com/intent/tweet?url={url_encoded_url}&amp;text={url_encoded_text}&amp;hashtags={url_encoded_hashtags}">Tweet This</a>

Tumblr

<a href="http://www.tumblr.com/share/link?url={url_encoded_url}&amp;name={url_encoded_post_title}&amp;description={url_encoded_post_text}">Share on Tumblr</a>
@adamcbrewer
adamcbrewer / viewbox-trim.js
Last active November 30, 2024 00:51
JS: Trim SVG viewbox
/**
* Will trim the whitespace around the SVG's viewbox
*
*/
var svg = document.getElementsByTagName("svg")[0];
var bbox = svg.getBBox();
var viewBox = [bbox.x, bbox.y, bbox.width, bbox.height].join(" ");
svg.setAttribute("viewBox", viewBox);
@adamcbrewer
adamcbrewer / entities.json
Created October 12, 2015 11:32
JSON: HTML Entity Reference
{
"ascii": [
{
"character": " ",
"entityName": "&nbsp;",
"entityNumber": "&#32;",
"description": "Space"
},
{
"character": "!",
@adamcbrewer
adamcbrewer / actions.js
Last active September 13, 2022 20:18
JS: React & Redux Component Kit
export const ACTION_KEY = 'ACTION_KEY';
// If a component has this method defined in `bindActionCrators`
// then this method can be called via `this.props.actionsFunction()`
// within the component.
export function actionFunction(value) {
return {
type: ACTION_KEY,
payload: value
};
@adamcbrewer
adamcbrewer / clipboard.history.json
Last active September 11, 2020 08:54
Visual Studio Code Settings Sync Gist
{
"version": 2,
"clips": []
}