sudo mkdir /etc/resolver
cat 'nameserver 8.8.8.8' > /etc/resolver/slack.com
SunCalc = (function() { | |
var J1970 = 2440588, | |
J2000 = 2451545, | |
deg2rad = Math.PI / 180, | |
M0 = 357.5291 * deg2rad, | |
M1 = 0.98560028 * deg2rad, | |
J0 = 0.0009, | |
J1 = 0.0053, | |
J2 = -0.0069, | |
C1 = 1.9148 * deg2rad, |
import prettierConfig from './.prettierrc' | |
const code = 'const foo = 1; const bar = 2;' | |
const out = prettier.format(code, { | |
...prettierConfig, | |
parser: 'typescript' | |
}) | |
console.log(out) |
import path from 'path' | |
const __dirname = path.dirname(fileURLToPath(import.meta.url)) |
When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.
In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:
import {MDXProvider} from '@mdx-js/react'; | |
import {MDXComponents} from 'components/MDX/MDXComponents'; | |
import {Toc} from 'components/Toc/Toc'; | |
import * as React from 'react'; | |
export interface MarkdownProps<Frontmatter> { | |
meta: Frontmatter; | |
children?: React.ReactNode; | |
} |
const portalComponent = wrapper.find(Portal).at(0); | |
const portalInstance = portalComponent.instance(); | |
const portalWrapper = new ReactWrapper(portalInstance.props.children); | |
portalWrapper.find(...) |
function branfuck(code, input){ | |
const output = []; | |
const data = []; | |
let dataPointer = 0; | |
let inputPointer = 0; | |
let inputArr = input.split('').map(i => i.codePointAt(0)) | |
const chars = code.split(''); | |
let codePointer = 0; | |
function mul(num1, num2) { | |
// Convert to array of string in reverse order (right to left calc) | |
num1 = `${num1}`.split('').reverse(); | |
num2 = `${num2}`.split('').reverse(); | |
// Init empty array | |
const d = []; | |
for(let i = 0; i < num1.length + num2.length; i++) { | |
d[i] = 0; |