Skip to content

Instantly share code, notes, and snippets.

View gfargo's full-sized avatar
🥫
Revolutionizing Food Regulation with Okayd

Griffen Fargo gfargo

🥫
Revolutionizing Food Regulation with Okayd
View GitHub Profile
@gfargo
gfargo / README.md
Last active September 6, 2022 17:13
Github Co-Pilot wrote all the tests...

Using Github Co-Pilot to write my Tests 🧪

Premise 🦾🤖

Can I speed up the process of writing tests for helper methods that I've just extracted from a Hook or Component 🤔🤨

Process ⚙️

I started by extracting the helper methods I had previously written inside the React Hook or Component into a seperate file adding exports & passing additional required variables.

@gfargo
gfargo / codingchallenge.md
Created March 10, 2021 14:36 — forked from granolocks/codingchallenge.md
Useful for Coding Exercises

Do as many of the following as you can in the time given. Order of completion does not matter.

CIPHER

Implement a Caesar cipher, both encoding and decoding. The key is an integer from 1 to 25. This cipher rotates the letters of the alphabet (A to Z). The encoding replaces each letter with the 1st to 25th next letter in the alphabet (wrapping Z to A). So key 2 encrypts "HI" to "JK", but key 20 encrypts "HI" to "BC". This simple "monoalphabetic substitution cipher" provides almost no security, because an attacker who has the encoded message can either use frequency analysis to guess the key, or just try all 25 keys.

@gfargo
gfargo / README.md
Last active January 11, 2019 16:55 — forked from learncodeacademy/deployUser.md
Guide to a hands-off self-hosted solution for WordPress

HOSH WP

Hands-Off Self-Hosted WordPress

Using CircleCI to Deploy Your Website

  • Create Deploy User in Forge
  • Generate SSH on local machine ( No password on SSH Key )
  • Add private key to deploy service ( CircleCI )
@gfargo
gfargo / class-admin-message.php
Created February 14, 2017 14:10
WP-Admin Notification Class
<?php
/**
* Creates Messages for WP Admin Screens
*
* @author gfargo
*/
class Admin_Message {
/**
@gfargo
gfargo / README.md
Created February 6, 2017 15:06 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@gfargo
gfargo / Callout.php
Last active August 4, 2016 21:25
Example WP Shortcodes
//
// Callout Shortcode
//
function callout_shortcode ($atts, $content = null) {
extract(shortcode_atts(array(
'title' => 'Product / Callout',
'subtitle' => '',
'text' => 'lorem content',
'image' => 'http://path/to/logo',
'align' => 'left',
@gfargo
gfargo / Items.js
Last active January 2, 2016 18:30
Using ReactiveVars in Meteor Templates
// Basic Items Template
// Great read on Reactivity in Meteor - https://www.discovermeteor.com/blog/reactivity-basics-meteors-magic-demystified/
// Called when Items template is first created - but not yet added to the DOM
Template.Items.onCreated(function() {
// Store template instance into expanitory variable
var template = this;
@gfargo
gfargo / Vagrantfile
Created October 16, 2015 20:33
Basic Template for Digital Ocean as Vagrant Provider - Deploy Droplet with Vagrant
####
# Digital Ocean Provider
#
# Update 'provider.token' to API Key given by Digital Ocean
#
####
config.vm.provider :digital_ocean do |provider, override|
# Add path to SSH key for Digital Ocean
override.ssh.private_key_path = 'path/to/ssh/key/id_rsa'
@gfargo
gfargo / Gruntfile.js
Last active September 23, 2015 15:42
Easy way to seperate out Grunt stuff to avoid massive gruntfiles
/*****************************************************
Grunt'd
This 'plop-in' plugin was created to expedite the
process of adding the required files for front-end
development.
This includes template scss files and `main.js`
@gfargo
gfargo / CustomMapWidget.php
Last active August 29, 2015 14:26
Extend 2amigos Leaflet Map Class - Allowing for Global access to Map variable
<?php
namespace app\components;
use dosamigos\leaflet\LeafLet;
use dosamigos\leaflet\widgets\Map;
use dosamigos\leaflet\LeafLetAsset;
use yii\base\InvalidConfigException;
use yii\base\Widget;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;