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 | |
$DASHBOARD_ID = "<DASHBOARD_ID>"; | |
// Check if MemberPress class is accessible | |
if(class_exists('MeprUtils')) { | |
$user = MeprUtils::get_currentuserinfo(); | |
// Check if the current user information is found | |
if($user != null) { | |
// Setting default region the where the dashboard is located. | |
putenv('AWS_DEFAULT_REGION=' . 'us-east-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
let testCase = process.argv[2]; // First arg will be test case key | |
let body = process.argv[3]; // Second arg will be body | |
let header = process.argv[4]; // Third arg will be header | |
let success = true; | |
switch (testCase) { | |
case "get_api": | |
if (success) { | |
process.exit(0); // For success case | |
} else { |
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
{ | |
"testCases": { | |
"get_api": { | |
"path": "/books", | |
"query": { | |
"id": "1" | |
}, | |
"expect": { | |
"body": { | |
"contains": { |
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
{ | |
"testCases": { | |
"get_api": { | |
"path": "/books", | |
"query": { | |
"id": "1" | |
} | |
}, | |
"post_api": { | |
"path": "/books", |
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
// CH002 :: Pythagorean Triplet | |
package main | |
import "fmt" | |
func pythagoreanTriplet(number int) (int, int, int) { | |
for first := 1; first <= number/2; first++ { | |
for second := first + 1; second <= number/2; second++ { | |
third := number - (first + second) | |
if (first*first)+(second*second) == (third * third) { |
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
package main | |
// CH006 :: Weird Number | |
import ( | |
"fmt" | |
) | |
func max(a, b int) int { | |
if a > b { |
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
package main | |
// CH005 :: Curious Number | |
import ( | |
"fmt" | |
"math" | |
) | |
func isCuriousNumber(number int) bool { |
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
package main | |
// CH004 :: Happy Number | |
import ( | |
"fmt" | |
"math" | |
) | |
func squaredDigitSum(number int) int { |
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
package main | |
// CH007 :: LCM of numbers | |
import "fmt" | |
func hcf(a, b int) int { | |
if a == 0 { | |
return b | |
} |
NewerOlder