Ruby 2.4.0 & Rails 5.2.0
$ curl -sSL https://get.rvm.io | bash -s stable --ruby=2.4.0| import React, { ReactNode } from 'react' | |
| import { useSpotifyAccessTokenFromAuthCode, useSpotifyAccessTokenFromRefreshToken } from './hooks' | |
| // Store them as environment variables! | |
| // | |
| const clientId = process.env.SPOTIFY_CLIENT_ID | |
| const clientSecret = process.env.SPOTIFY_CLIENT_SECRET | |
| const redirectUri = process.env.SPOTIFY_REDIRECT_URI | |
| const clientPayload = { clientId, clientSecret, redirectUri } |
| // | |
| // AppDelegate.swift | |
| // iOS SDK Quick Start | |
| // | |
| // Created by Spotify on 14/06/2018. | |
| // Copyright © 2018 Spotify for Developers. All rights reserved. | |
| // | |
| import UIKit |
| (function(date_of_birth, decimal_points){ | |
| var date_today = Date.now() | |
| , date_born = Date.parse(date_of_birth) | |
| , difference = date_today - date_born; | |
| var divided_to_seconds = difference / 1000 | |
| , divided_to_minutes = divided_to_seconds / 60 | |
| , divided_to_hours = divided_to_minutes / 60 | |
| , divided_to_days = divided_to_hours / 24 | |
| , divided_to_years = divided_to_days / 365; |
| https://mlh.io/seasons/f2013/events | |
| https://mlh.io/seasons/s2014/events | |
| https://mlh.io/seasons/f2014/events | |
| https://mlh.io/seasons/f2014-uk/events | |
| https://mlh.io/seasons/s2015/events | |
| https://mlh.io/seasons/2015-eu/events | |
| https://mlh.io/seasons/f2015/events | |
| https://mlh.io/seasons/f2015-eu/events | |
| https://mlh.io/seasons/s2016/events | |
| https://mlh.io/seasons/s2016-eu/events |
This is part of a blog post series that I'm writing called Advanced Jekyll which you can find on [my website, bilaw.al][site].
You can read the blog post [Building API's in Jekyll by clicking here][post].
All the code in this gist is what I use to build API's with in Jekyll.
This is a small script I wrote that allows you to parse information of your flight when connected to United's In-Flight Wi-Fi. It provides information such as expected/actual departure, arrivals, airports, temperatures, altitude, ground speed, miles accrued for the flight and the flight number.
Copy united.rb to your computer and install the following gems:
$ gem install httparty
| // Go to https://www.spotify.com/account/subscription/receipt/ | |
| var Receipt = function(jquery){ | |
| this.id = $(jquery).find(".receipt-orderid").text(); | |
| this.id = $.trim(this.id); | |
| this.id = parseInt(this.id); | |
| this.date = $(jquery).find(".receipt-date").text(); | |
| this.date = new Date(Date.parse(this.date)); | |
| /** | |
| * jQuery function to match two div heights. Disables for mobiles so the experience is better. | |
| */ | |
| $.fn.matchHeightWith = function(jqSelector) { | |
| if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { | |
| return; | |
| } | |
| var match_a = $(this).height(); |