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
# Adapted from https://claude.site/artifacts/adb7d26c-d81e-4df8-a8ba-d33ae4747a16 | |
# very slight changes to some regexes | |
import argparse | |
import os | |
import re | |
from typing import List, Dict, Optional, Tuple | |
import requests | |
from bs4 import BeautifulSoup |
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 src = [3, 4, 8, 9] | |
/** | |
* @param {number[]} input | |
* @param {number[]} source | |
* @returns | |
*/ | |
function update(input, source) { | |
if (input.length === 0) return [...source] | |
if (source.length === 0) return [...input] |
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
# Remove the "downloads" object from 1.20.2_mcp.json | |
jq ".downloads = {}" 1.20.2_mcp.json | sponge 1.20.2_mcp.json | |
# update the "id" to match folder name | |
jq ".id = '1.20.2_mcp'" 1.20.2_mcp.json | sponge 1.20.2_mcp.json | |
# With the base files extrcted into a folder called `base` run the follwing command: |
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
Number.prototype.milliseconds = function() { return this } | |
Number.prototype.seconds = function() { return Number.prototype.milliseconds.call(this * 1000) } | |
Number.prototype.minutes = function() { return Number.prototype.seconds.call(this * 60) } | |
Number.prototype.hours = function() { return Number.prototype.minutes.call(this * 60) } | |
Number.prototype.days = function() { return Number.prototype.hours.call(this * 24) } | |
Number.prototype.weeks = function() { return Number.prototype.days.call(this * 7) } | |
Number.prototype.fortnights = function() { return Number.prototype.weeks.call(this * 2) } | |
Number.prototype.in = function() { | |
const that = this; |
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
@ECHO OFF | |
@REM SET SOUND=C:\SB16 | |
@REM SET BLASTER=A220 I5 D1 H5 P330 T6 | |
@REM SET MIDI=SYNTH:1 MAP:E | |
@REM SET CTCM=C:\SB16 | |
@REM C:\SB16\DIAGNOSE /S /W=C:\WINDOWS | |
@REM C:\SB16\MIXERSET /P /Q | |
@REM C:\SB16\CTCU.EXE /S /W=C:\WINDOWS | |
PROMPT $p$g | |
PATH C:\NET;C:\WINDOWS;C:\DOS;C:\XTGOLD;C:\TC\BIN;C:\WP51;C:\SOFTMPU;C:\MIDIEMU |
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 java.util.Arrays; | |
public class Examples { | |
public static void main(String ... args) { | |
Solution s = new Solution(); | |
System.out.print("Example problem: "); | |
System.out.println(s.shortest(3, 3, | |
Arrays.asList( | |
Arrays.asList(1, 0, 0), |
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
//An example of this can be seen at https://jsfiddle.net/uLzwv8mx/ | |
function HueSegments(steps) { | |
var segments = [] | |
var step | |
var increment = 200/steps | |
for(step = 0; step < steps; step++) { | |
segments.push("hsla("+(Math.floor(increment*step))+", 100%, "+(step % 2 == 0 ? "75" : "50")+"%, 1)") | |
} | |
return segments | |
} |
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 deepSet(keys, value) { | |
return keys.split('.') | |
.reverse() | |
.reduce((acc, current) => ({ | |
[current]: acc | |
}), value); | |
} | |
//You can use it like this: | |
console.log(JSON.stringify(deepSet('foo.name.social.twitter.followers', 100))) |
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
/* | |
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* - Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* |
NewerOlder