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
// Similar-ish to styled-components' interface but no theming and this one uses | |
// js to create style. It styles any component with a style property that matches | |
// StyleProp from react native and provides intelisense to the styles available | |
// on that particular component. | |
import React, { ComponentType } from 'react'; | |
import { StyleProp } from 'react-native'; | |
type StyleableProp = { style?: StyleProp<unknown> }; | |
export function styled<P extends StyleableProp>( |
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
:root { | |
--ion-safe-area-top: 44px; | |
--ion-safe-area-bottom: 34px; | |
} |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{45a84344-802a-4122-840d-89db0ae8d015}", | |
"profiles": | |
{ | |
"defaults": | |
{ | |
}, | |
"list": | |
[ |
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 class LinkedList<T> implements Iterable<T> { | |
public first: LinkedListNode<T> = null; | |
public get isEmpty(): boolean { | |
return this.first === null; | |
} | |
public push(item: T): void { | |
this.first = new LinkedListNode<T>(item, this.first); | |
} |
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 binarySearch(input, target) { | |
let x0 = 0; | |
let x1 = input.length - 1; | |
while (x0 <= x1) { | |
let x = Math.round(x0 + (x1 - x0) / 2); | |
if (target < input[x]) { | |
x1 = x - 1; | |
} else if (target > input[x]) { |
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 sort(input) { | |
if (input.length < 2) { | |
return input; | |
} | |
const q = parseInt(input.length / 2); | |
const a = input.slice(0, q); | |
const b = input.slice(q, input.length); |
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
// Testing fibonacci different implementations | |
/* | |
F(n) = { | |
n = 0 : 1, | |
n = 1 : 1, | |
n > 1 : F(n-1) + F(n-2) | |
} | |
*/ | |
function fib_full_recursive(n) { |
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
body { | |
background-image: linear-gradient(45deg, #64b5f6, #ba68c8); | |
/* add room for animating the background position */ | |
background-size: 200%; | |
background-position: right; | |
height: 100vh; | |
animation: bganim 20s infinite; | |
} |