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
// get a list of articles based on search endpoint | |
import { gql, GraphQLClient } from 'npm:graphql-request' | |
import sanitizeHtml from 'npm:sanitize-html' | |
import epub, { Chapter } from 'npm:epub-gen-memory' | |
const OMNIVORE_API_KEY = '' | |
const OMNIVORE_ENDPOINT = 'https://api-prod.omnivore.app/api/graphql' | |
const graphQLClient = new GraphQLClient(OMNIVORE_ENDPOINT, { | |
headers: { |
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
version: '2.4' | |
networks: | |
http_network: | |
external: true | |
mastodon_network: | |
external: false | |
internal: true |
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
// ==UserScript== | |
// @name Remove Zhihu | |
// @namespace http://pornhub.com/ | |
// @version 0.1 | |
// @description browse zhihu without login | |
// @author You | |
// @match https://www.zhihu.com/* | |
// @grant none | |
// ==/UserScript== |
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 asyncOnce = (fn) => { | |
const promise | |
return (...args) => { | |
if (!promise) { | |
promise = fn.apply(null, args) | |
} | |
return promise | |
} | |
} |
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 request = require('request') | |
const cheerio = require('cheerio') | |
const urls = [ | |
'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&anliegen[]=120686&dienstleisterlist=122210,122217,122219,122227&herkunft=http%3A%2F%2Fservice.berlin.de%2Fdienstleistung%2F120686%2F', | |
'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&dienstleister=122210&anliegen[]=120686&herkunft=1', | |
'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&dienstleister=122217&anliegen[]=120686&herkunft=1', | |
'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&dienstleister=122219&anliegen[]=120686&herkunft=1', | |
'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&dienstleister=122227&anliegen[]=120686&herkunft=1', | |
'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&anliegen[]=120686&dienstleisterlist=122231,122243&herkunft=http%3A%2F%2Fservice.berlin.de%2Fdienstleistung%2F120686%2F', |
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
// matchfilters performance: https://github.com/yarnpkg/yarn/blob/master/src/util/filter.js#L96 | |
const path = require('path'); | |
let filter = { | |
base: 'node_modules/xml-escape', | |
isNegation: false, | |
regex: /^(?:(?!\.)(?=.)[^\/]*?\.seed)$/i | |
}, | |
basename = 'branches', |
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
# -*- coding: utf-8 -*- | |
import encodings.utf_8 | |
import math | |
import urllib, urllib2 | |
import random | |
import re | |
from xml.dom import minidom | |
from LevenshteinDistance import LevenshteinDistance | |
from grabber import LyricProviderBase |
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
// this codemod will replace all 'lodash/<whatever>/<func>' -> 'lodash/<func>' | |
// usage: jscodeshift -t tools/lodash-3-4.js src | |
let transformModuleName = (name) => { | |
let matchObj = name.match(/^lodash\/(.*)\/(.*)/) | |
if(matchObj) { | |
return ['lodash', matchObj[2]].join('/') | |
} | |
return name | |
} |
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
module.exports = { | |
// ... | |
module: { | |
loaders: [{ | |
test: /\.module\.(scss|css)$/, | |
loaders: [ | |
'style-loader', 'css-loader?module', 'autoprefixer-loader', | |
'sass-loader' | |
] | |
}, { |
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
int stepSize = 5; | |
int r = -45; | |
draw() { | |
rotate(radians(r)); | |
r += stepSize; | |
NewerOlder