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 fs from "fs"; | |
| import PDFParser from "pdf2json"; | |
| const handler = async (req, res) => { | |
| res.setHeader("Access-Control-Allow-Credentials", "true"); | |
| res.setHeader("Access-Control-Allow-Origin", "*"); | |
| res.setHeader("Access-Control-Allow-Headers", "*"); | |
| res.setHeader("Access-Control-Allow-Methods", "*"); | |
| // enable CORS for OPTIONS (no need to return any body) |
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
| #EXTM3U | |
| #EXTINF:-1,BBC - Radio 1 | |
| http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_radio_one.m3u8 | |
| #EXTINF:-1,BBC - Radio 1Xtra | |
| http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_1xtra.m3u8 | |
| #EXTINF:-1,BBC - Radio 1Dance | |
| http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_radio_one_dance.m3u8 | |
| #EXTINF:-1,BBC - Radio 1Relax | |
| http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_radio_one_relax.m3u8 | |
| #EXTINF:-1,BBC - Radio 2 |
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
| // Implement a firestore data provider for react-admin | |
| import { | |
| GET_LIST, | |
| GET_ONE, | |
| CREATE, | |
| UPDATE, | |
| UPDATE_MANY, | |
| DELETE, | |
| DELETE_MANY, |
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
| #!/bin/bash | |
| if [ -z "$1" ]; then | |
| echo "waiting for the following arguments: username + max-page-number" | |
| exit 1 | |
| else | |
| name=$1 | |
| fi | |
| if [ -z "$2" ]; then |
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, { useState } from 'react' | |
| import useLocalStorage from './useLocalStorage' | |
| import useUpdateLogger from './useUpdateLogger' | |
| function App() { | |
| const [name, setName] = useLocalStorage('name', '') | |
| useUpdateLogger(name) | |
| return ( | |
| <div> | |
| <h1>Hello</h1> |
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
| #Write all site html | |
| class Spider(scrapy.Spider): | |
| name = "posts" | |
| start_urls = [ | |
| 'https://blog.scrapinghub.com/page/1/', | |
| 'https://blog.scrapinghub.com/page/2/' | |
| ] | |
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 http = require("http") | |
| const server = http.createServer((req, res) => { | |
| res.setHeader("Content-type", "application/json") | |
| res.setHeader("Access-Control-Allow-Origin", "*") | |
| res.writeHead(200) | |
| let dataObj = { id: 1, name: "oskar" } | |
| let data = JSON.stringify(dataObj) | |
| console.log(req.url) |
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 capitalize = (name) => { | |
| name = name.toLowerCase(); | |
| return `${name.charAt(0).toUpperCase()}${name.slice(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
| version: "3.3" | |
| services: | |
| ################################################ | |
| #### Traefik Proxy Setup ##### | |
| ############################################### | |
| traefik: | |
| image: traefik:v2.0 | |
| restart: always |
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
| version: "3.3" | |
| services: | |
| caddy: | |
| image: abiosoft/caddy:1.0.3-no-stats | |
| container_name: caddy | |
| hostname: caddy | |
| restart: unless-stopped | |
| volumes: |
NewerOlder