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
<ion-grid> | |
<ion-row> | |
<ion-col> | |
<button ion-button margin (click)="pushPage(pages.menus.items[1])">SPORTS</button> | |
<button ion-button margin (click)="pushPage(pages.menus.items[2])">BUTTON2</button> | |
<button ion-button margin (click)="pushPage(pages.menus.items[3])">BUTTON3</button> | |
</ion-col> | |
<ion-col> | |
<button ion-button margin (click)="pushPage(pages.menus.items[4])">BUTTON4</button> |
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
<ion-grid> | |
<ion-row> | |
<ion-col col-6 *ngFor="let p of pages.menus.items" [ngClass]="p.extra_classes"> | |
<ion-card (click)="pushPage(p)" class="menu-card"> | |
<div class="card-title"><ion-icon *ngIf="p.class" name="{{p.class}}"></ion-icon></div> | |
<div class="card-subtitle">{{p.title}}</div> | |
</ion-card> | |
</ion-col> | |
</ion-row> | |
</ion-grid> |
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
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2); | |
function add_login_logout_link($items, $args) { | |
ob_start(); | |
wp_loginout('index.php'); | |
$loginoutlink = ob_get_contents(); | |
ob_end_clean(); | |
$items .= '<li>'. $loginoutlink .'</li>'; | |
return $items; | |
} |
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
/* Main redirection of the default login page */ | |
function qs_redirect_login_page() { | |
$login_page = home_url('login'); | |
$page_viewed = basename($_SERVER['REQUEST_URI']); | |
if($page_viewed == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') { | |
wp_redirect($login_page); | |
exit; | |
} | |
} |
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
/** | |
* Redirect user after successful login. | |
* | |
* @param string $redirect_to URL to redirect to. | |
* @param string $request URL the user is coming from. | |
* @param object $user Logged user's data. | |
* @return string | |
*/ | |
function qs_login_redirect( $redirect_to, $request, $user ) { | |
//is there a user to check? |
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
public static int CountPossibleClusters( int totalRelics, int checkNum ) { | |
int next_checkNum = 0; | |
switch (checkNum) { | |
case 6: | |
next_checkNum = 5; | |
break; | |
case 5: | |
next_checkNum = 4; | |
break; |
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
/* | |
Write a method multi_array_sum to find (and return) the sum of all the numbers in a | |
multi-dimensional array of integers. A multi-dimensional array is an array for which | |
at least some elements are themselves arrays. In this example every array and sub-array | |
will only contain integers and/or more sub-arrays. | |
SAMPLE OUTPUT | |
Given a multi-dimensional array: | |
a = [1, [2, [3,4]], [5,6] ] |
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
/* | |
sample output: | |
if the function call were check_divisors( [2,3], 1, 7) the printed output would be: | |
1 | |
2 one_match | |
3 one_match | |
4 one_match | |
5 |
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 clock_angles(hour, minute) { | |
// note: there are 360 degrees around the clock interface | |
// calculate the degree position of the hour hand | |
hourDegree = 30 * hour; | |
// calculate how far the hour hand is from zero | |
if ( hourDegree < 180 ) { | |
hourDifference = hourDegree; |
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 reverseArray( arrayToInvert ) { | |
// create a variable for the new array | |
var invertedArray = []; | |
// count how many things are in the original array | |
numLoops = arrayToInvert.length; | |
// loop that many times backwards and put each element into the new array | |
for ( i = numLoops -1; i >= 0; i-- ) { | |
invertedArray.push( arrayToInvert[i]); |
NewerOlder