Skip to content

Instantly share code, notes, and snippets.

View jmahc's full-sized avatar
🏠
Working from home

Jordan McArdle jmahc

🏠
Working from home
View GitHub Profile
//------------------------
// General/Matchmaking Settings (begin)
//------------------------
mm_dedicated_search_maxping “70″
cl_autowepswitch "0"
cl_loadout_colorweaponnames "1"
cl_mute_enemy_team "1"
cl_bob_lower_amt "30"
cl_bobamt_lat ".1"
cl_viewmodel_shift_left_amt ".5"
@jmahc
jmahc / _typography.less
Created August 26, 2016 14:32
LESS Repsonsive Typography
@min_width: 400;
@max_width: 800;
@min_font: 12;
@max_font: 24;
@min_width-px: unit(@min_width, px);
@max_width-px: unit(@max_width,px);
@min_font-px: @min_font * 1px;
@max_font-px: @max_font * 1px;
:root {
@jmahc
jmahc / _reboot.less
Last active August 26, 2016 14:57
This is _reboot.scss converted to .LESS for bootstrap v4 alpha
@cursor-disabled : not-allowed;
@font-size-root : 16px;
@font-size-base : 1rem;
@font-family-sans-serif : BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
@font-family-base : @font-family-sans-serif ;
@brand-primary : #0275d8;
@gray-dark : #373a3c;
@gray-light : #818a91;
@jmahc
jmahc / getVisibleHeight.js
Created August 26, 2016 18:50
This gets the height of any element relative to what is visible on screen
function getVisibleHeight(el) {
var elementHeight = el.offsetHeight;
var windowHeight = window.innerHeight;
var rect = el.getBoundingClientRect();
var topValue = rect.top;
var bottomValue = rect.bottom;
return Math.max(0, topValue > 0 ? Math.min(elementHeight, windowHeight - topValue) : (bottomValue < windowHeight ? bottomValue : windowHeight));
}
@jmahc
jmahc / cssTransitionEnd.js
Last active August 27, 2016 23:31
This listens for the end of an element's CSS transition event.
(function() {
var e = document.getElementsByClassName('sample')[0];
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'OTransition':'oTransitionEnd',
@jmahc
jmahc / getRatio.js
Created August 27, 2016 23:04
Gets a ratio using javascript.
function getRatio(a, b) {
return Math.min(a, b) / Math.max(a, b);
};
@jmahc
jmahc / smart-underline.js
Created August 28, 2016 22:19
eager.io's JS file for smart-underline
(function() {
var PHI, backgroundPositionYCache, calculateBaselineYRatio, calculateTextHighestY, calculateTypeMetrics, clearCanvas, containerIdAttrName, containsAnyNonInlineElements, containsInvalidElements, countParentContainers, destroy, fontAvailable, getBackgroundColor, getBackgroundColorNode, getFirstAvailableFont, getLinkColor, getUnderlineBackgroundPositionY, hasValidLinkContent, init, initLink, initLinkOnHover, isTransparent, isUnderlined, linkAlwysAttrName, linkBgPosAttrName, linkColorAttrName, linkContainers, linkHoverAttrName, linkLargeAttrName, linkSmallAttrName, performanceTimes, renderStyles, selectionColor, sortContainersForCSSPrecendence, styleNode, time, uniqueLinkContainerID;
window.SmartUnderline = {
init: function() {},
destroy: function() {}
};
if (!(window['getComputedStyle'] && document.documentElement.getAttribute)) {
return;
@jmahc
jmahc / colors.less
Last active August 30, 2016 18:19
List of color variables with names. Consistently used throughout my projects (WIP)
// Color names generated by:
// 1. https://coolors.co/
// 2. http://chir.ag/projects/name-that-color/
// Colors =========================================
// ====== Generic
//
// Black -> Grays w/ #'s
//
@color-black : #000000;
@jmahc
jmahc / _colors.sass
Last active April 4, 2017 03:47
Colors for sass
//
// Colors
//
$color-black: #000;
$color-licorice: #111;
$color-raisin-black: #222;
$color-jet: #333;
$color-arsenic: #444;
$color-davy-gray: #555;
$color-granite-gray: #666;
@jmahc
jmahc / regex.txt
Created September 7, 2016 19:41
Commonly used Regex by Jordan McArdle
// Selects id's inside of an HTML tag that has a space before it.
` id="[^"]+"`
// Select `headings"` inside of an HTML tag that has a double quote after it, without a space or hyphen before it.
// Used to grab the class name headings in this case
`(?<! )+(?<!-)+(?=headings")\w+([headings"])`