Skip to content

Instantly share code, notes, and snippets.

View AlanWilsonWeb's full-sized avatar
☠️
Hack The Planet!

Alan Wilson AlanWilsonWeb

☠️
Hack The Planet!
View GitHub Profile
@AlanWilsonWeb
AlanWilsonWeb / JSQuestion.js
Last active September 10, 2020 19:01
JavaScript Group Question 9/14/20
function calculate(x){
let y = x.length
if(y > 1){
return 1
}
else if(y > 2){
return 2
}
@AlanWilsonWeb
AlanWilsonWeb / json.php
Last active November 28, 2018 14:20
Solution to Wilber Code Challenge
<?php
$people = '{"data":[{"first_name":"jake","last_name":"bennett","age":31,"email":"jake@bennett.com","secret":"VXNlIHRoaXMgc2VjcmV0IHBocmFzZSBzb21ld2hlcmUgaW4geW91ciBjb2RlJ3MgY29tbWVudHM="},{"first_name":"jordon","last_name":"brill","age":85,"email": "jordon@brill.com","secret":"YWxidXF1ZXJxdWUuIHNub3JrZWwu"},]}';
//Engage "Super Secret Spy Award" ;)
//Trim off the "," at the end of the JSON that is preventing us from decoding, without directly manipulating the source
$people[-3] = " ";
//Decode JSON to something we can work with
$tempArray = json_decode($people, true);