This file contains hidden or 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
/** | |
* Methods required by a custom player for `react-player` | |
*/ | |
export interface Player { | |
load(url?: string): void; | |
seekTo(amount: number, type?: 'seconds' | 'fraction'): void; | |
getCurrentTime(): number; | |
getDuration(): number; | |
getSecondsLoaded(): number | null; | |
stop?(): void; |
This file contains hidden or 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 React, { Component } from "react"; | |
import ReactPlayer, { ReactPlayerProps } from "react-player"; | |
import { getSDK } from "react-player/lib/utils"; | |
import { | |
Player, | |
IkWidget, | |
KalturaNotificationName, | |
KalturaPlayerElement, | |
KalturaPlayerEvents, |
This file contains hidden or 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
<?php | |
/* @ http://stackoverflow.com/a/12628971 */ | |
function isValidUrl($url){ | |
// first do some quick sanity checks: | |
if(!$url || !is_string($url)){ | |
return false; | |
} | |
// quick check url is roughly a valid http request: ( http://blah/... ) | |
if( ! preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i', $url) ){ | |
return false; |
This file contains hidden or 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 fs = require("fs"); | |
const path = require("path"); | |
function fixFile(filepath) { | |
const contents = fs.readFileSync(filepath, "utf-8"); | |
const matcher = /([0-9]+(?:\.[0-9]+)?)rem/igm; | |
const result = contents.replaceAll(matcher, (substr, size) => { | |
const rem = Number(size); |
This file contains hidden or 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 fs = require('fs'); | |
var https = require('https'); | |
var blob_host = 'tconeu.blob.core.windows.net'; | |
var blob_container = 'tessel-uploads'; | |
// Use any tool to generate a Shared Access Key e.g. Azure Management Studio | |
var blob_sas = '?sr=c&sv=2014-02-14&si=tessel&sig=xxxxRv%2xxxxUTd8xxxxMKc0xxxxi%2Fxxxxw6VsxxxxGjdJxxxx'; | |
var blob_name = 'test.jpg'; |
This file contains hidden or 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 classNameProp from 'class-name-prop'; | |
import { useRouter } from 'next/router'; | |
import React from 'react'; | |
import styles from './RouteIndicator.module.css'; | |
const DONE_DURATION = 250; | |
export default function RouteIndicator() { | |
const router = useRouter(); |
This file contains hidden or 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
request | |
response | |
app | |
req | |
res | |
originalUrl | |
state | |
_i18n | |
matched | |
router |
This file contains hidden or 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
/** | |
* Validates hex value | |
* @param {String} color hex color value | |
* @return {Boolean} | |
*/ | |
function isValidHex(color) { | |
if(!color || typeof color !== 'string') return false; | |
// Validate hex values | |
if(color.substring(0, 1) === '#') color = color.substring(1); |
This file contains hidden or 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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
//configure httpclient service | |
services.AddHttpClient("GithubAPI", client=> | |
{ | |
//customize as per your need | |
client.BaseAddress = new Uri("http://api.github.com/"); | |
client.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json"); |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
namespace TestAPIGithub.Controllers | |
{ |