This file contains hidden or 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
[V, D] = eig(A); | |
[nuDiag,order] = sort(diag(D),'descend'); | |
D = diag(nuDiag); | |
V=V(:,order); |
This file contains hidden or 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
updateParams : function() { | |
$('.class').on('change', function(e) { | |
e.preventDefault(); | |
let url = window.location.pathname; | |
if ( $(this).prop('checked') ) { | |
let query_string = this.buildParamStr('param-name', 'param-value', true); | |
window.history.pushState('old-ai-state', '', url + query_string); | |
} else { | |
let query_string = this.buildParamStr('ai_fwp_filter', null, false); | |
window.history.pushState('old-ai-state', '', url + query_string); |
This file contains hidden or 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 following function to a child theme or plugin: | |
// Class exists check in case adding to a plugin and themes are swapped. | |
if ( class_exists ( 'Anno_Keeper' ) ) { | |
function anno_custom_header_size() { | |
Anno_Keeper::keep( 'header_image', new Anno_Header_Image( 'header', array ( 1265, 110 ) ) ); | |
} | |
// Priority 10 to come in after the annotum's initial template initialization. |
This file contains hidden or 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
ModifyGraph rgb(Bran2_Arm_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Bran4N_Dist_T)=(26112,52224,0),rgb(Darapi_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Dusmatovite_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Eifelite_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Kl_chite_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Merrihueite_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Mila25_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Mila29a_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Mila29b_Dist_T)=(26112,52224,0);DelayUpdate | |
ModifyGraph rgb(Mila30_Dist_T)=(26112,52224,0),rgb(Mila31_Dist_T)=(26112,52224,0);DelayUpdate |
This file contains hidden or 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 | |
// Prevents duplicate term creation, useful when terms need to be programatically generated | |
function create_term( $slug, $name, $taxonomy ) { | |
$term_id = term_exists( $slug, $taxonomy ); | |
if ( ! $term_id ) { | |
$term_data = wp_insert_term( $name, $taxonomy, array( 'slug' => $slug ) ); | |
if ( $term_data && ! is_wp_error( $term_data ) ) { | |
$term_id = $term_data['term_id']; | |
} | |
} |
This file contains hidden or 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
// Add a value to a specific range of points of a wave | |
Function addToWaveRange(wname, startPoint, endPoint, addition) | |
wave wname | |
variable startPoint | |
variable endPoint | |
variable addition | |
variable ii | |
for ( ii=0; ii< (endPoint-startPoint); ii += 1 ) | |
wname[startPoint + ii] += addition |
This file contains hidden or 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 | |
$taxonomies = array( | |
'taxonomy-slug' => array( | |
'labels' => array( | |
'name' => __('Genres', 'textdomain'), | |
'singular_name' => __('Genre', 'taxonomy singular name', 'textdomain'), | |
'menu_name' => __('Genre', 'textdomain'), | |
'all_items' => __('All Genres', 'textdomain'), | |
'edit_item' => __('Edit Genre', 'textdomain'), | |
'view_item' => __('View Genre', 'textdomain'), |
This file contains hidden or 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 create_menu() { | |
add_options_page(__('Plugin Settings', 'ejda'), __('Plugin Settings', 'ejda'), 'manage_options', 'ejda-slug', 'options_page_content'); | |
} | |
add_action('admin_menu', 'create_menu'); | |
function options_page_content() { | |
?> | |
<div class="wrap"> |
This file contains hidden or 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
#!/bin/bash | |
if [ -z $1 ]; then | |
echo "Usage: inputs.sh file.txt" | |
else | |
codes=$(grep -o "###.*###" $1) | |
inputs=$(echo $codes | sed 's/#//g') | |
for x in $inputs; do | |
#Check if the variable is empty |
This file contains hidden or 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 | |
$arr = array(); | |
$arr['foo'] = 'bar'; | |
// 'boo' evaluates to 0 | |
echo $arr['foo']['boo']; // b | |
// This evaluates as true and echos | |
if (isset($arr['foo']['boo'])) { |
NewerOlder