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 / 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 / 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 / client-app.js
Last active August 29, 2015 14:22 — forked from jackiig/client-app.js
Template.CommentAdd.events({
'submit form': function(e, tmpl) {
e.preventDefault();
formEl = tmpl.find('form');
comment = tmpl.find('[name=comment]').value;
if (comment.trim().length == 0) { return false; };
Comments.insert({
login: Meteor.user().profile.login,
timestamp: new Date,
room: Session.get('activeRoom'),
@gfargo
gfargo / is_blog.php
Last active December 19, 2015 12:48 — forked from wesbos/is_blog.php
Returns 'True' when the user is on a Wordpress 'Blog' page.
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
Usage:
<?php if (is_blog()) { echo 'You are on a blog page'; } ?>