Skip to content

Instantly share code, notes, and snippets.

View joshmedeski's full-sized avatar

Josh Medeski joshmedeski

View GitHub Profile
@joshmedeski
joshmedeski / gist:7981565
Last active December 31, 2015 11:48
wp: header title
<!-- Title Credit: http://perishablepress.com/how-to-generate-perfect-wordpress-title-tags-without-a-plugin/ -->
<title>
<?php if (function_exists('is_tag') && is_tag()) {
echo 'Tag Archive for &quot;'.$tag.'&quot; — ';
}
elseif (is_archive()) {
wp_title(''); echo ' Archive — ';
}
elseif (is_search()) {
echo 'Search for &quot;'.wp_specialchars($s).'&quot; — ';
@joshmedeski
joshmedeski / gist:9099487
Created February 19, 2014 19:18
GENERATE SAFE TEXT COLORS WITH SASS
$lightness-bound : 70 !global;
$hue-bound-bottom : 40 !global;
$hue-bound-top : 200 !global;
@function checkDangerZone($color) {
@if ( (lightness($color) > $lightness-bound) or (hue($color) > $hue-bound-bottom and hue($color) < $hue-bound-top )) {
@return darken(desaturate($color, 70), 60);
}
@else {
<?php
/**
* Count number of widgets in a sidebar
* Used to add classes to widget areas so widgets can be displayed one, two, three or four per row
*/
function slbd_count_widgets( $sidebar_id ) {
// If loading from front page, consult $_wp_sidebars_widgets rather than options
// to see if wp_convert_widget_settings() has made manipulations in memory.
global $_wp_sidebars_widgets;
@joshmedeski
joshmedeski / mpu-links.md
Created November 13, 2015 18:09
2015 SassConf Unconference Mac Power Users Links
@joshmedeski
joshmedeski / index.html
Last active November 6, 2019 21:03
Perfect Base Layout with Flexbox
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Flexbox Layout</title>
<style>
body {
margin: 0;
@joshmedeski
joshmedeski / graphql.yaml
Created March 8, 2021 03:27
Deploying a GraphQL server through Google Cloud App Engine with GitHub Actions
on:
push:
branches:
- main
paths:
- "graphql/**"
- ".github/workflows/graphql.yml"
jobs:
deploy:
@joshmedeski
joshmedeski / tmux.conf
Last active March 18, 2021 16:54
TMUX OS Specific status-right
# macOS (with Nerd Font)
set -g status-right "#[fg=white,bold,bg=default]%l:%M %a, %b %d "
set -ga status-right "#[fg=black,bold,bg=white]  "
# linux/popOS (with Nerd Font)
set -g status-right "#[fg=cyan,bold,bg=default]%l:%M %a, %b %d "
set -ga status-right "#[fg=black,bold,bg=cyan]  "
@joshmedeski
joshmedeski / .prettierrc.json
Created December 28, 2021 18:16
My Prettier Config
{
"importOrder": ["^@/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"printWidth": 80,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none"
live_config_reload: true
window:
opacity: 0.85
padding:
x: 18
y: 16
dynamic_padding: false
decorations: buttonless
@joshmedeski
joshmedeski / vim-tmux-navigator.lua
Created December 21, 2023 14:51
vim tmux navigator setup with lazy.nvim
-- lazy.nvim setup for seamless navigation between tmux panes and vim splits
-- https://github.com/christoomey/vim-tmux-navigator
return {
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",