Skip to content

Instantly share code, notes, and snippets.

👌
¯\_(ツ)_/¯

Ryan Christiani Rchristiani

👌
¯\_(ツ)_/¯
Block or report user

Report or block Rchristiani

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Sort object
//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
};
View Spotify Auth Flow
//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`,
View billy-starwars.js
//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
View mock-data
[{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
View gist:0edf81d5b1a022d5ef37
### 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 Oct 29, 2013
PHP: My Code Snippet
View gist:7221915
<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');
}
?>
You can’t perform that action at this time.