Skip to content

Instantly share code, notes, and snippets.

View JeremyEnglert's full-sized avatar

Jeremy Englert JeremyEnglert

View GitHub Profile
@JeremyEnglert
JeremyEnglert / Accordion Grid for JointsWP 4
Last active April 24, 2016 18:11
Use an "Accordion Archive" with JointsWP
<?php get_header(); ?>
<div id="content">
<div id="inner-content" class="row">
<main id="main" class="large-8 medium-8 columns" role="main">
<ul class="accordion" data-accordion role="tablist">
// PACKAGE.JSON //
{
"name": "JointsWP-Builder",
"version": "4.0.0",
"description": "Converts Sass version to CSS version.",
"repository": {
"type": "git",
"url": ""
},
"author": "Jeremy Englert",
@JeremyEnglert
JeremyEnglert / style.scss
Created February 9, 2016 18:02
Add Foundation Icons to JointsWP
/******************************************************************
Stylesheet: Main Stylesheet
Here's where the magic happens. Here is where you import
all of your Sass files so they can compile into one
CSS file.
******************************************************************/
<aside id="sidebar" class="left-sidebar small-16 large-3 columns large-pull-13">
<h1>NewsCheck Archive</h1>
<?php do_action('foundationpress_before_sidebar'); ?>
<?php
$single_post_id = get_the_ID();
$terms = get_the_terms($single_post_id, 'aps_page_group');
import asyncio
import random
import time
async def myCoroutine(id):
process_time = random.randint(1,5)
await asyncio.sleep(process_time)
print("Coroutine {}, has finished after {} seconds.".format(id, process_time))
async def main():
import random
import time
def myCoroutine(id):
process_time = random.randint(1,5)
time.sleep(process_time)
print("Coroutine {}, has finished after {} seconds.".format(id, process_time))
def main():
start = time.time()
@JeremyEnglert
JeremyEnglert / train_test_classifier.py
Created June 22, 2018 01:21
Python Machine Learning Sentiment Classifier using NLTK Twitter Corpus
import nltk
from nltk.corpus import twitter_samples
#####
##### SENTIMENENT FUNCTION
#####
def naiveBayesSentimentCalculator(review):
problemInstance = review.split()
problemFeatures = extract_features(problemInstance)
return trainedNBClassifer.classify(problemFeatures)
@JeremyEnglert
JeremyEnglert / build.js
Created October 12, 2018 08:11
Inquirer Promise Chaining
inquirer
.prompt([
{
type: 'list',
name: 'framework',
message: 'What framework would you like to install?',
choices: ['None', 'Foundation', 'Bootstrap'],
}
])
.then(answers => {
@JeremyEnglert
JeremyEnglert / build.js
Last active April 22, 2020 02:58
JavaScript Async/Await with Inquirer
async function startTheme() {
try {
const answers = await inquirer.prompt(questions);
const themeSetup = await Promise.all ([
downloadFramework(answers.framework), // This task takes some time to run
installFramework(answers.framework),
changeThemeName(answers.themeName),
changeNamespace(answers.themeNamespace),
changeLocalUrl(answers.themeLocalUrl)
])
@JeremyEnglert
JeremyEnglert / beaver-builder-improvements.php
Created November 10, 2018 07:41
Set BeaverBuilder as Default Editor
// Sets Beaver Builder as the default editor.
function make_beaver_builder_default( $post_ID, $post, $update ) {
if ( ! $update ) {
update_post_meta( $post_ID, '_fl_builder_enabled', true );
}
}
add_action( 'wp_insert_post', 'make_beaver_builder_default', 10, 3 );