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
const str = "Jane Doe<https://jane.doe.homepage>,Joe Bloggs,Juan Perez<https://some.socialmedia/juan>" | |
const splits = str.split(",") | |
const translators = [] | |
for (const split of splits) { | |
const name = split | |
const regexResults = name.match(new RegExp('<(.*?)>')) | |
const url = regexResults && regexResults[1] | |
const translator = { | |
name: url ? name.substr(0, regexResults.index) : name, | |
url |
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
import axios from 'axios' | |
import { PV } from '~/resources' | |
axios.defaults.withCredentials = true | |
type PVRequest = { | |
endpoint?: string | |
query?: {} | |
body?: any | |
headers?: any |
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
import OmniAural, { useOmniAural } from "omniaural" | |
import { useTranslation } from "react-i18next" | |
import Modal from 'react-modal' | |
import { ButtonClose, ButtonLink, ButtonRectangle, TextInput } from "~/components" | |
import { login } from "~/services/auth" | |
type Props = {} | |
export const LoginModal = (props: Props) => { | |
const [login] = useOmniAural("modals.login") |
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
retrieveUserAndAllSubscribedPodcasts(id, params = {}) { | |
const { | |
MediaRef, | |
Playlist | |
} = this.Models; | |
if (id && id !== params.userId) { | |
throw new errors.Forbidden(); | |
} |
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
describe('feedParser', function () { | |
describe('when an invalid RSS URL is provided', function () { | |
it('should throw an error', function (done) { | |
feedParser.parseFeed('http://www.podverse.fm/fakepage') | |
.catch(err => { | |
console.log(err); | |
expect(err).to.equal('Bad Status Code'); | |
done(); |
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
var env = nunjucks.configure(__dirname + '/templates', { | |
autoescape: true, | |
cache: false, | |
express: app | |
}); | |
env.addFilter('stringify', function(str) { | |
return JSON.stringify(str); | |
}); |
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
import Foundation | |
class SavePlaylistToServer: WebService { | |
internal init(playlist:Playlist, completionBlock: (response: Dictionary<String, AnyObject>) -> Void, errorBlock: (error: NSError?) -> Void) { | |
super.init(name:"playlist", completionBlock: completionBlock, errorBlock: errorBlock) | |
setHttpMethod(.METHOD_POST) | |
addHeaderWithKey("Content-Type", value: "application/json") | |
addParamWithKey("playlistTitle", value: playlist.title ?? "") |
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
{ | |
"playlist": [ | |
{ | |
"title": "#265 - The episode where some stuff happened", | |
"duration": "50:25", | |
"pubDate": "2016-02-07 22:30:55 +0000", | |
"mediaURL": "http://traffic.libsyn.com/lavenderhour/DTFH_183_Aaron_Frank.mp3", | |
"podcast": { | |
"title": "The Best Podcast Ever Show", | |
"imageURL": "https://pbs.twimg.com/profile_images/483390499030450177/tMc95Jty_400x400.jpeg" |
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
{ | |
items: [ | |
{ | |
title: "#265 - The episode where some stuff happened", | |
duration: "50:25", | |
pubDate: "2016-02-07 22:30:55 +0000", | |
mediaURL: "http://traffic.libsyn.com/lavenderhour/DTFH_183_Aaron_Frank.mp3", | |
podcast: { | |
title: "The Best Podcast Ever Show", | |
imageURL: "https://pbs.twimg.com/profile_images/483390499030450177/tMc95Jty_400x400.jpeg" |
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
{ | |
playlist: { | |
episode: { | |
title: "#265 - The episode where some stuff happened", | |
duration: "50:25", | |
pubDate: "2016-02-07 22:30:55 +0000", | |
podcast: { | |
title: "The Best Podcast Ever Show" | |
} | |
}, |
NewerOlder