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
console.log(`Hello Cygni!`); |
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
async function fetchJson(url) { | |
const response = await fetch(url); | |
if (!response.ok) { | |
throw new Error( | |
`GET ${url} ${response.status} - ${response.statusText} `, | |
); | |
} | |
return response.json(); | |
} |
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
export type MockImplementation<T = any, Y extends any[] = any> = ( | |
...args: Y | |
) => T; | |
export interface Mock<T = any, Y extends any[] = any> { | |
calls: Y[]; | |
reset(): void; | |
setImplementation(impl: MockImplementation<T, Y>): Mock<T, 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
// https://github.com/microsoft/TypeScript/issues/30878 | |
// https://github.com/denoland/deno/issues/3089 | |
console.log(`${"dummy string"}`) | |
console.log(`import { foo } from "./bar.ts"`) |
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 algolia = require("algoliasearch") | |
const client = algolia(ALGOLIA_APPLICATIONID, ALGOLIA_APIKEY) | |
async function run() { | |
const source = client.initIndex("test-index-from") | |
const target = client.initIndex("test-index-to") | |
const task = await client.copyIndex(source.indexName, target.indexName) | |
await source.waitTask(task.taskID) | |
} |
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
// @ts-check | |
import { useState, useEffect } from 'react' | |
function getCurrentLocation () { | |
return { | |
pathname: window.location.pathname, | |
search: window.location.search | |
} | |
} |
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
// @ts-check | |
import { useState, useEffect } from 'react' | |
function getCurrentLocation () { | |
return { | |
pathname: window.location.pathname, | |
search: window.location.search | |
} | |
} |
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
// @ts-check | |
import { useState, useEffect } from 'react' | |
/** | |
* @param {() => AsyncIterableIterator<T>} iterator | |
* @param {T} [defaultValue] | |
* @returns {T} | |
* @template T | |
*/ | |
export function useIterator (iterator, defaultValue) { |
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
using NUnit.Framework; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ClassLibrary2 | |
{ | |
[TestFixture] | |
public class TestFixture | |
{ |
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
using System.Net.Http; | |
using System.Text; | |
using Newtonsoft.Json; | |
namespace Lenkan.StrengthLog.Data.Couch | |
{ | |
public class JsonContent : StringContent | |
{ | |
public JsonContent(string s) : base(s, Encoding.UTF8, "application/json") | |
{ } |