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 scriptTags = Array.from(document.querySelectorAll('script')); | |
const scriptSrcs = scriptTags.map(tag=>tag.src).filter(i=>i); | |
const SOURCE_MAPPING_URL = "//# sourceMappingURL="; | |
const maybeSourceMappingURLs = await Promise.allSettled(scriptSrcs.map(async(src)=>{ | |
const code = await fetch(src).then(resp=>resp.text()); | |
const lastLine = code.split("\n").pop(); | |
if (!lastLine.startsWith(SOURCE_MAPPING_URL)) { | |
throw new Error('This scripts don\'t have sourcemap'); |
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
// Zeller's Congruence function | |
function zellersCongruence(year, month, day) { | |
if (month < 3) { | |
month += 12; | |
year -= 1; | |
} | |
const A = year % 100; | |
const B = Math.floor(year / 100); | |
const F = A + Math.floor(A / 4) + Math.floor(B / 4) - 2 * B + Math.floor(13 * (month + 1) / 5) + day; |
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
# -*- encoding: utf-8 -*- | |
from six.moves.urllib.parse import urlparse | |
from thefuck.utils import for_app, memoize | |
@memoize | |
def get_hostname_from_url(maybeUrl): | |
try: | |
results = urlparse(maybeUrl) | |
return results.hostname |
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
# The grammar for path data | |
# it's implementing the svg 1.1 spec | |
# https://www.w3.org/TR/SVG11/paths.html#PathDataBNF | |
# | |
# N.B. This Implementation Is Ambiguous! | |
# e.g. M0.6.5 -> M 0 6.5 | M 0.6 0.5 | |
# | |
@{% | |
const it = (it) => it; |
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 path = require('path'); | |
module.exports = { | |
apps: [ | |
{ | |
name: 'fan-ctrl', | |
cwd: path.resolve(__dirname), | |
interpreter: 'python3', | |
cmd: 'fan_ctrl.py', | |
// Options reference: https://pm2.keymetrics.io/docs/usage/application-declaration/ |
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 ratioConfig = (x, y) => ({ | |
x, | |
y, | |
ratio: x / y | |
}) | |
const commonRatio = [ratioConfig(1, 1), ratioConfig(4, 3), ratioConfig(16, 9), ratioConfig(16, 10)]; | |
const getRatioConfig = (x, y) => { |
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
function instanceOf(inst, cls) { | |
if (inst === null || inst === undefined) | |
return false; | |
if (typeof cls !== 'function') | |
throw new TypeError("Second parameter is not a constructor"); | |
let instance = inst; | |
while (instance.__proto__) { | |
if (instance.__proto__ === cls.prototype) { | |
return 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
<canvas id="stage"></canvas> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
</style> | |
<script> | |
const stg = document.getElementById('stage'); |
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
local image = app.activeCel.image:clone() | |
local black = Color { r = 0, g = 0, b = 0, a = 255 } | |
local white = Color { r = 255, g = 255, b = 255, a = 255 } | |
local width = image.width | |
local height = image.height | |
local size = width * height | |
local nearest = 0.1 | |
local farest = 1000 |
This file has been truncated, but you can view the full file.
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
4602713413433154453264452332101823124660178999927878775099623274628544000826084520729275137386306313610970039542134019169094479911539667758765706548388262709395910401447414275192972397095100372901062558411172027994823308339118707411212899705108784191046990030246902890430162768476917897544323686963363526638329586402598537684995297467531450584152322402629527753056672068582799976452955077140364435633611627743030006882994464389706629103466042439399187818912431754020828466328554047723057801189261674789207224541262917263083945860320625674536625026002950952262398064897919271988481419068961330802400103216397852978258771045078666755642257479872208814339437518538616439414227876160324202838202693667701117389124410449965409845122982315624918113650650381630365765220616683628335407025058495890159377056162851945512758383382009140042967905216072731650772908134476998576255535178729325770930240128556117231001128605001837891938772915337002956920498855579997481972474558715755099585396947510028754873131439722605891277408245136842 |
NewerOlder