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
type Value = ObjectValue | ArrayValue | StringValue | NumberValue | BooleanValue; | |
interface ObjectValue { | |
type: 'object'; | |
values: Record<string, Value>; | |
optional?: boolean; | |
} | |
interface ArrayValue { | |
type: 'array', |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 path from 'node:path'; | |
import stream from 'node:stream'; | |
import { git } from './spawn.js'; | |
import { Repository } from './repository.ts'; | |
import { FastifyPluginCallback } from 'fastify'; | |
export const api: FastifyPluginCallback = (fastify, _opts, done) => { | |
const gitSmartSchema = { | |
type: 'object', | |
properties: { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#![feature(macro_metavar_expr)] | |
macro_rules! repeat_2 { | |
($($what:tt)*) => { | |
$($what)* | |
$($what)* | |
} | |
} | |
macro_rules! make_repeat_from { |
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 formatUSD = n => '$' + n.toFixed(2).replace(/(?<=\b\d+)(?=(?:\d{3})+\b)/g, ','); |
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
// fix encoding (utf-8 misinterpreted as latin1) | |
derp=(s,...n)=>n.map(v=>v.wholeText?v.data=s(v.data):derp(s,...v.childNodes));derp(s => (new TextDecoder).decode(new Uint8Array(s.split('').map(c => c.charCodeAt(0)))), document.body) | |
// rewrite entire page to derp | |
derp=(s,...n)=>n.map(v=>v.wholeText?v.data=s(v.data):derp(s,...v.childNodes));derp(s=>s.replace(/\w+/g,'derp'),document.body) |
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 { formatWithOptions } from 'util'; | |
import winston, { Logform, format, transports } from 'winston'; | |
import chalk, { ChalkInstance } from 'chalk'; | |
import moment from 'moment'; | |
const FORMAT_OPTIONS = { | |
depth: null, | |
maxArrayLength: null, | |
breakLength: 120, | |
colors: process.stdout.isTTY |
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
require 'matrix.rb' | |
def vector_rotation_to_quaternion(v1, v2) | |
b = v1.dot(v2) | |
c = v1.cross(v2) | |
angle = Math.atan2(c.norm(), b) | |
m = Math.sin(angle / 2) | |
if c.zero? then | |
a = c | |
else |
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
#!/bin/bash | |
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7 | |
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n | |
# Install Oracle JDK 8 | |
apt install openjdk-8-jdk | |
# Get SDK tools (link from https://developer.android.com/studio/index.html#downloads) | |
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip |
NewerOlder