Skip to content

Instantly share code, notes, and snippets.

View greymechanic's full-sized avatar
🛠️
building

Andrew Dash greymechanic

🛠️
building
View GitHub Profile
@greymechanic
greymechanic / colorMap.js
Last active July 24, 2019 20:41
Color mapping for Flexport Q3 2019 brand refresh
const colors = Object.freeze({
blackDoNotUse: {
old: "#000000",
new: "",
map: null,
},
black: {
old: "",
new: "#39414D",
map: null,
const styleLocations = {
v: ["-top", "-bottom"],
h: ["-left", "-right"],
l: ["-left"],
r: ["-right"],
t: ["-top"],
b: ["-bottom"],
a: [""],
};
function SearchFilter($query) {
if ($query->is_search) {
// specific categories to search
$query->set('cat', '8,9,12');
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');
function SearchFilter($query) {
if ($query->is_search) {
// specific post to search
$query->set('post_type', 'feeds');
}
return $query;
}
// loop
add_filter('pre_get_posts','SearchFilter');
@greymechanic
greymechanic / iconHoverJ.coffee
Created May 5, 2015 20:42
Icon hover Jquery replace
$('img.social').hover (->
pathA = '/wp-content/themes/pollyport/assets/images/social-'
theId = $(this).attr 'id'
pathB = '-2x-green.png'
path = siteUrl + pathA + theId + pathB
$(this).attr 'src', path
), ->
pathA = '/wp-content/themes/pollyport/assets/images/social-'
theId = $(this).attr 'id'
pathB = '-2x.png'
@greymechanic
greymechanic / vertical-align.scss
Created April 3, 2015 16:45
Easy vertical align mixin
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@greymechanic
greymechanic / hamburger-toggle.scss
Created April 3, 2015 16:43
Hamburger X Toggle Animation
/*
*
*
* Hamburger X Toggle
*
*
*/
#nav-toggle {
cursor: pointer;
@include padding(1em 0.5em 1em 1em);
@greymechanic
greymechanic / _main.scss
Created April 3, 2015 16:39
visual grid color indicators
body{
background: $blue;
@include media($small-up) {
background: purple;
}
@include media($medium-up) {
background: green;
}
@include media($large-up) {
background: black;
@greymechanic
greymechanic / _grid-settings.scss
Created April 3, 2015 16:39
grid settings for neat
@import "neat/neat-helpers"; // or "../neat/neat-helpers" when not in Rails
// Overrides
$column: 80px;
$gutter: 30px;
$grid-columns: 6;
$max-width: em(1600);
// Breakpoints
$small: em(640);