Skip to content

Instantly share code, notes, and snippets.

View joelkrause's full-sized avatar

Joel Krause joelkrause

View GitHub Profile

$breakpoints: (mobile: 480px, tablet-portrait: 768px, tablet-landscape: 1024px, laptop: 1200px, desktop: 1400px, desktop_large: 1920px, );

@each $name, $size in $breakpoints { .column-#{$name} {

$breakpoints: (mobile: 480px, tablet-portrait: 768px, tablet-landscape: 1024px, laptop: 1200px, desktop: 1400px, desktop_large: 1920px, );

body,
html {
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
margin: 0;
padding: 0;
}
body,
html {
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
margin: 0;
padding: 0;
}
@joelkrause
joelkrause / get-set-transient.php
Created October 9, 2019 22:06
Getting OpenWeatherMap with WordPress Transients
<?php
function setWeatherCelcius() {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.openweathermap.org/data/2.5/weather?id=2208305&APPID=db6889d62a3a881cb6c204dc256c0bae&units=metric",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
@joelkrause
joelkrause / ipad_pro_mq.css
Created October 9, 2019 01:31
ipad pro media queries
/* ----------- iPad Pro ----------- */
/* Portrait and Landscape */
@media only screen
and (min-width: 1024px)
and (max-height: 1366px)
and (-webkit-min-device-pixel-ratio: 1.5) {
}
/* Portrait */
@media only screen
@joelkrause
joelkrause / gulpfile.js
Created October 6, 2019 10:10
gulpfile.js for compiling sass and js files
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var pipeline = require('readable-stream').pipeline;
// This compiles the sass files into one
gulp.task('compile', () => {
@joelkrause
joelkrause / strip_url.js
Created September 9, 2019 03:03
Strip URL and leave hash value to scroll to section
$(window).on('load', function () {
function toTitleCase(str) {
return str.replace(/(?:^|\s)\w/g, function (match) {
return match.toUpperCase();
});
}
if (window.location.hash) {
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
// Add scroll to function in here
// hash found
@joelkrause
joelkrause / add_xml_to_svg
Created September 4, 2019 03:54
add the xml code to an svg to allow to upload to wordpress
<?xml version="1.0" encoding="utf-8"?>
@joelkrause
joelkrause / wp_nav.php
Last active September 1, 2019 23:19
wp nav walker for header file
<?php
wp_nav_menu( array(
'theme_location' => 'Primary',
'menu_id' => 'Primary',
'container' => false
) );
?>