Skip to content

Instantly share code, notes, and snippets.

View zachary-russell's full-sized avatar

Zachary Russell zachary-russell

View GitHub Profile
@zachary-russell
zachary-russell / functions.php
Created July 2, 2018 20:18
Conditionally Enqueue JavaScript
<?php
// Hook into WordPress to load the scripts
add_action('wp_enqueue_scripts', 'mfp_conditional_scripts');
function mfp_conditional_scripts() {
// Add global script
wp_enqueue_script('global', get_stylesheet_directory_uri() . '/js/global.min.js', ['jquery'], '', true);
if( is_home() ) {
// Homepage Scripts
wp_enqueue_script('homepage', get_stylesheet_directory_uri() . '/js/homepage.min.js', ['jquery'], '', true);

Keybase proof

I hereby claim:

  • I am zachary-russell on github.
  • I am zacharyrussell (https://keybase.io/zacharyrussell) on keybase.
  • I have a public key ASDQ2YtrcVEh983vEXaWy3zj1k_-ZJI-_gRix1a1VpArtwo

To claim this, I am signing this object:

@zachary-russell
zachary-russell / auth-check.js
Last active June 2, 2020 14:46
Firestore Security Rules
import * as firebase from "firebase/app";
import { db } from "./db";
import "firebase/auth";
/**
* Check if the account used for login is valid
*
* @returns {Promise}
*/
function validAccountCheck() {
const user = firebase.auth().currentUser;
@zachary-russell
zachary-russell / script.go
Created August 31, 2020 19:27
FB Delete Users example
package main
import (
"bufio"
"bytes"
"context"
"encoding/csv"
"encoding/json"
"cloud.google.com/go/firestore"
@zachary-russell
zachary-russell / sqoosh-image.sh
Last active August 7, 2022 13:37
Squoosh CLI Optimization
squoosh-cli --mozjpeg '{"quality":75,"baseline":false,"arithmetic":false,"progressive":true,"op timize_coding":true,"smoothing":0,"color_space":3,"quant_table":3,"trellis_multipass":false,"trel lis_opt_zero":false,"trellis_opt_table":false,"trellis_loops":1,"auto_subsample":true,"chroma_sub sample":2,"separate_chroma_quality":false,"chroma_quality":75}' actionvance-guy5aS3GvgA-unsplash.jpg
@zachary-russell
zachary-russell / main.dart
Created July 28, 2021 16:39
Swipe Button w/ Gravity
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
void main() => runApp(SwipeDemoApp());
class SwipeDemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(