Skip to content

Instantly share code, notes, and snippets.

View nateluzod's full-sized avatar
🎯
Focusing

Nate Luzod nateluzod

🎯
Focusing
View GitHub Profile
@nateluzod
nateluzod / lor-data-colors
Created December 1, 2022 05:57
LOR Data Colors
{
"neutral" : [
{
"gray" : {
"dark" : "#2F3634",
"light" : "#868688"
}
}
],
"data" : [
@nateluzod
nateluzod / get-content-by-term.php
Created April 21, 2021 01:51
Timber/Twig Filter - get content by term
<?php
/**
* Get content by taxonomy
* Sorts in reverse-cron
* @param category {integer} the ID of the term we're pulling from
* @param postType {string, array} the post type(s) we're drawing from
* @param numberPosts {integer} the number of posts we'd like back
*/
@nateluzod
nateluzod / csv_to_wp_posts.php
Last active April 13, 2019 19:08
Create posts from a CSV in WordPress.
<?php
/**
* Run w/in same directory as CSV
*/
$file = fopen( dirname( __FILE__ ) . "/filename.csv", "r" );
while( !feof( $file )){
$line = fgetcsv( $file );
@nateluzod
nateluzod / settings.json
Created September 1, 2017 21:36
VS Code Settings
{
"editor.fontSize": 16,
"editor.lineHeight": 36,
"editor.showFoldingControls": "always",
"git.enableSmartCommit": true,
"terminal.integrated.fontSize": 14,
"terminal.integrated.lineHeight": 2,
"workbench.iconTheme": "easy-icons",
"workbench.colorTheme": "Atom One Dark",
"window.zoomLevel": 0,
@nateluzod
nateluzod / .travis.yml
Created August 29, 2017 19:09
Travis config for deploying Hugo app to S3 bucket
# Auto deploy repo from Github to Amazon S3 bucket via Travis CI
# * Set env vars for ACCESS_KEY_ID and SECRET_ACCESS_KEY on Travis
# * Update `bucket.name` in `sync` command
# * Assumes your `publishDir` is the default (`public`) - if not update `sync` command
language: go
install: go get -v github.com/spf13/hugo
script:
- hugo
- python --version
@nateluzod
nateluzod / vscode-settings.json
Created August 23, 2017 22:44
VS Code Settings
{
"workbench.colorTheme": "One Dark Pro",
"editor.fontSize": 16,
"editor.fontFamily": "Menlo",
"editor.lineHeight": 36,
"window.zoomLevel": 0,
"git.enableSmartCommit": true,
"terminal.integrated.fontSize": 16,
"terminal.integrated.lineHeight": 2,
"terminal.integrated.cursorBlinking": true,
@nateluzod
nateluzod / gist:88e1bfe820111129ad38e75d516fc8a0
Created December 19, 2016 00:40
Show git branch in terminal prompt
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
@nateluzod
nateluzod / .bash_profile
Created April 27, 2016 18:57
Get WP-CLI to use MAMP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
@nateluzod
nateluzod / gist:f11a0dbb7947472820dd
Created December 29, 2015 06:10
Drush won't connect to MySQL on MAMP
# Create a symlink to MAMP's mysql.sock where Drush is looking
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
@nateluzod
nateluzod / gist:8d0d35734c13255d9fac
Created December 5, 2015 01:33
WordPress - Add Admin User
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('newadmin', MD5('pass123'), 'firstname lastname', 'email@example.com', '0');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');