Skip to content

Instantly share code, notes, and snippets.

View Rchristiani's full-sized avatar
👌
¯\_(ツ)_/¯

Ryan Christiani Rchristiani

👌
¯\_(ツ)_/¯
View GitHub Profile
//How can you take this object and find the key with the highest value.
const locations = {
park: 10,
forest: 1,
mountains: 14,
beach: 4,
indoors: 7
};
//This is used to get the initial token
app.auth = () => $.ajax({
method: 'POST',
headers: {
'Content-Type' : 'application/json',
'Accept': 'application/json'
},
url: 'http://proxy.hackeryou.com ',
data: JSON.stringify({
reqUrl: `https://accounts.spotify.com/api/token`,
//Function to get all the characters from the passed data
const getCharacters = (charArray) => {
//With that array of data map it and return a fetch for each of them
return charArray.map(url => fetch(url).then(res => res.json()))
}
//Call all the films
fetch(`http://swapi.co/api/films/`)
//Convert response to json
.then(res => res.json())
//Get the results
[{title: 'Test Note 1',content: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaeca cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',author: 'Ryan Christiani'},{title: 'Test Note 2',content: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaeca cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur
### Keybase proof
I hereby claim:
* I am rchristiani on github.
* I am rchristiani (https://keybase.io/rchristiani) on keybase.
* I have a public key whose fingerprint is 7A7C 4B1B 31D2 4826 9546 DF40 721D E741 1D16 04FC
To claim this, I am signing this object:
@Rchristiani
Rchristiani / gist:7221915
Created October 29, 2013 20:23
PHP: My Code Snippet
<div class="alignright">
<?php
if($data['header_right_content'] == 'Contact Info') {
get_template_part('framework/headers/header-info');
} elseif($data['header_right_content'] == 'Social Links') {
get_template_part('framework/headers/header-social');
} elseif($data['header_right_content'] == 'Navigation') {
get_template_part('framework/headers/header-menu');
}
?>