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 / 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(
@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 / 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 / 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;

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 / 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);
@zachary-russell
zachary-russell / index.js
Created October 4, 2017 17:13
Google Cloud Form Processing Script
var api_key = 'YOUR-KEY-HERE';
var sending_domain = 'sandbox3d603fef70dc4a3db61d4f9de9854c46.mailgun.org';
var mailgun = require('mailgun-js')({apiKey: api_key, domain: sending_domain});
exports.processForm = function processForm(req, res) {
query = req.query;
var data = {
from: query.fname + ' ' + query.lname + ' <' + decodeURIComponent(query.email) + '>',
to: 'zach@protechig.com',
@zachary-russell
zachary-russell / googlefonts.php
Created May 29, 2015 22:02
Google Font WordPress
function pt_add_google_fonts() {
wp_enqueue_style('google-fonts', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,700,300');
}
add_action( 'pt_add_google_fonts', 'wp_enqueue_scripts' );
@zachary-russell
zachary-russell / plugin.php
Created March 31, 2015 15:46
WordPress Plugin Starter File
<?php
/**
* Plugin Name: My Plugin
* Plugin URI:
* Description:
* Version: 1.0
* Author: ProTech Internet Group
* Author URI: https://protechig.com
* License: GPL2
* /
@zachary-russell
zachary-russell / wordpress.conf
Last active August 29, 2015 14:11
Nginx Virtual Host HHVM w/ WordPress
server {
listen 80;
server_name localhost; # or replace localhost with domain name
include hhvm.conf;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /var/www;
index index.php;