Skip to content

Instantly share code, notes, and snippets.

View rxnlabs's full-sized avatar

De'Yonte W. rxnlabs

View GitHub Profile
@rxnlabs
rxnlabs / sublime-text-example-project-file-1920.json
Last active August 29, 2015 14:04
Sublime Text - SublimeText 3 example project file. One I personally use
{
"folders":
[
{
"follow_symlinks": true,
"path": "."
}
],
"settings":
{
@tim-peterson
tim-peterson / US State full name => two-digit abbrev conversion
Created February 1, 2013 21:23
Match state by its full name and return the two digit abbreviation (PHP)
$state='Massachusetts';
$state=ucfirst($state);
$states=array('AK' => 'Alaska', 'AL' => 'Alabama', 'AR' => 'Arkansas', 'AZ' => 'Arizona', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DE' => 'Delaware', 'DC' => 'District of Columbia', 'FL' => 'Florida', 'GA' => 'Georgia', 'HI' => 'Hawaii', 'IA' => 'Iowa', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'MA' => 'Massachusetts', 'MD' => 'Maryland', 'ME' => 'Maine', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MS' => 'Mississippi', 'MO' => 'Missouri', 'MT' => 'Montana', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'NE' => 'Nebraska', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NV' => 'Nevada', 'NY' => 'New York', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VA' => 'Virginia', 'VT' => 'V
@rxnlabs
rxnlabs / git-clone-submodule-to-path-track-branch
Last active June 23, 2016 16:13
Git - resetting changed submodules, updating submodules to the latest commit from the master branch. Easy way to work with Git submodules after changing files or when something goes wrong with trying to update submodules.
git submodule add -b master link_to_git_repo_here_ssh_or_https path_to_clone_git_submodule_to_here
@CodeVachon
CodeVachon / gulpfile.babel.js
Last active November 25, 2017 16:44
React Setup with Babel, Gulp, and Browserify
import gulp from 'gulp';
import browserify from 'browserify';
import source from 'vinyl-source-stream';
import buffer from 'vinyl-buffer';
import eslint from 'gulp-eslint';
import exorcist from 'exorcist';
import browserSync from 'browser-sync';
import watchify from 'watchify';
import babelify from 'babelify';
import uglify from 'gulp-uglify';
@irmiller22
irmiller22 / interview_prep.md
Last active March 20, 2018 04:37
FS-BK Interview Prep

Data Structure Basics

Array

Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
  • They are one of the oldest, most commonly used data structures.

What you need to know:

@rxnlabs
rxnlabs / wordpress-get-paragraph-excerpt-end-of-sentence.php
Last active June 21, 2018 14:27
WordPress - WP Get the excerpt starting at the end of a sentence. Get an excerpt of a paragraph and show the "Read More" link after the end of a sentence. Can be modified to use in other PHP apps.
<?php
/**
* Get the excerpt of a paragraph or string of long text.
*
* Get the shortened version of text for the wyisiwig. Use with custom wysiwyg (e.g. Advanced Custom Fields). This will print the paragraph and breaks tag but will strip all other tags
*
* @since 2014-11-06
* @version 2016-03-09
* @author De'Yonte W.<rxnlabs@github.com>
@makbeta
makbeta / clo-body-class.html
Last active October 18, 2018 14:33
Luminate Online: body class based on application
class="[[T9:
[[?x[[S4]]x::x41x::ecards::]]
[[?x[[S4]]x::x81x::profile::]]
[[?x[[S4]]x::x82x::interests::]]
[[?x[[S4]]x::x83x::unsubscribe::]]
[[?x[[S4]]x::x85x::preferences::]]
[[?x[[S4]]x::x5x::tell-a-friend::]]
[[?x[[S4]]x::x186x::service-center::]]
[[?x[[S4]]x::x10x::user-login [[?x[[S334:CMD]]x::xForgotPasswordx::password-recovery ::]][[?x[[S334:CMD]]x::xForgotLoginx::user-name-recovery ::]]::]]
@jeffsebring
jeffsebring / responsive_wordpress.css
Created April 1, 2012 05:43
Responsive WordPress Core Theme Styles
/**
* Responsive WordPress Core Theme Styles
* http://jeffsebring.com/responsive-wordpress-images/
--------------------------------------------------- */
.sticky,
.bypostauthor,
.gallery-caption {
display: normal;
}
@fjarrett
fjarrett / gist:5544469
Last active June 17, 2019 16:13
Return an attachment ID using a URL in WordPress
<?php
/**
* Return an ID of an attachment by searching the database with the file URL.
*
* First checks to see if the $url is pointing to a file that exists in
* the wp-content directory. If so, then we search the database for a
* partial match consisting of the remaining path AFTER the wp-content
* directory. Finally, if a match is found the attachment ID will be
* returned.
*
@jekkilekki
jekkilekki / wp-social-menu.md
Created September 22, 2015 09:12
Social Menu Code from Justin Tadlock

Register Social menu in functions.php

register_nav_menus( array(
    'top'     => esc_html__( 'Top Menu', 'theme-slug' ),
    'social'  => esc_html__( 'Social Menu', 'theme-slug' ),
) );

Create menu in inc/template-tags.php