This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add the metabox. | |
*/ | |
function my_url_add_metabox() { | |
add_meta_box( | |
'my_url_section', // The HTML id attribute for the metabox section | |
'My URL Metabox Title', // The title of your metabox section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let someChars = ['A', 'B', 'C', 'D']; | |
/** | |
* Handle all permutations for one array item (in relation to all other array items) | |
*/ | |
function permutateAgainstOneItem(arr) { | |
let [first, ...tail] = arr; | |
let head = [first]; | |
let permutations = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = { | |
people: [ | |
{ | |
id: 1, | |
name: "Mark Hamill", | |
birthday: "September 25, 1951", | |
placeOfBirth: "Oakland, California, USA", | |
bio: | |
"Mark Hamill is best known for his portrayal of Luke Skywalker in the original Star Wars trilogy.", | |
filmography: [1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helper to format GraphQL data into section list data | |
export const formatSessionData = sessions => { | |
return sessions | |
.reduce((acc, curr) => { | |
const timeExists = acc.find(section => section.title === curr.startTime); | |
timeExists | |
? timeExists.data.push(curr) | |
: acc.push({ title: curr.startTime, data: [curr] }); | |
return acc; | |
}, []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# COMMUNITY PROJECT GITIGNORE # | |
# Ignore OS files # | |
# =============== # | |
.DS_Store | |
.DS_Store? | |
._* | |
.Spotlight-V100 | |
.Trashes | |
ehthumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
staging: | |
scheme: sftp | |
host: PROJECT-NAME.cp.academy.red | |
port: 22 | |
user: YOUR PROJECT NAME | |
pass: YOUR SFTP PASSWORD | |
check: true | |
include: | |
"themes/[YOUR-THEME-NAME]/build/**": "themes/[YOUR-THEME-NAME]/build/" | |
exclude: [ "README.md", ".gitignore", "themes/[YOUR-THEME-NAME]/.eslintrc", "themes/[YOUR-THEME-NAME]/gulpfile.js", "themes/[YOUR-THEME-NAME]/package.json", "themes/[YOUR-THEME-NAME]/package-lock.json", "themes/[YOUR-THEME-NAME]/js/**", "themes/[YOUR-THEME-NAME]/sass/**" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_city_population_function( $value ){ | |
return 'Vancouver'; | |
} | |
add_filter( 'gform_field_value_my_city', 'my_city_population_function' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Account Login */ | |
/*-----------------------------------------*/ | |
.app-wrapper { | |
align-items: center; | |
display: flex; | |
justify-content: center; | |
height: 100vh; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function no_duplicate_votes($validation_result){ | |
global $wpdb; | |
$nominee_field = 1; | |
$email_field = 2; | |
$form = $validation_result['form']; | |
foreach( $form["fields"] as &$field ) { | |
if ( $field['id'] == $email_field ) { | |
$email_value = rgpost("input_{$field['id']}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Usage: "echo get_option('plugin_error');" or look for the option the DB after activation | |
* | |
* @link http://thehungrycoder.com/wordpress/how-i-have-solved-the-the-plugin-generated-xxxx-characters-of-unexpected-output-during-activation-problem.html | |
*/ | |
function save_error(){ | |
update_option( 'plugin_error', ob_get_contents()) ; |