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
package co.zimly.experimentalpha | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.BackHandler | |
import androidx.activity.compose.setContent | |
import androidx.compose.animation.core.animateFloatAsState | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.isSystemInDarkTheme | |
import androidx.compose.foundation.layout.* |
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
use num::{ | |
bigint::{BigUint, ToBigUint}, | |
traits::One, | |
ToPrimitive, | |
}; | |
fn factorial(num: u32) -> BigUint { | |
let mut result = BigUint::one(); | |
for i in 1..=num { | |
result *= i; |
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 { useEffect } from "react"; | |
const promiseMap = new WeakMap(); | |
function usePromise(promise) { | |
let data = {}; | |
if (promiseMap.has(promise)) { | |
data = promiseMap.get(promise); | |
} else { | |
promiseMap.set(promise, data); | |
} |
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 React from 'react' | |
import PropTypes from 'prop-types' | |
function transformImage(image, options) { | |
const imageService = 'https://img2.storyblok.com/' | |
const path = image.replace('https://a.storyblok.com', '') | |
return imageService + options.join('/') + path | |
} | |
function getSrcSet({ src, width, height, format, quality, scales }) { |
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 | |
command=$1 | |
args=${@:2} | |
winrun_pid=$$ | |
pidfile="/tmp/winrun-pid-$(date +%s)" | |
if [[ $args != '' ]]; then | |
argumentlist="-ArgumentList \"$args\"" | |
fi |
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 | |
if [ "$1" == "--version" ]; then | |
version=$(reg.exe query 'HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon' /v version | grep version) | |
echo $version | sed -r -e 's/version\s+REG_SZ\s+/Google Chrome /' | |
exit | |
fi | |
userprofile=$(cmd.exe /C 'echo %userprofile%' | tr -d '\r\n') | |
cypress_folder="$HOME/.config/Cypress" |
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 readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
const digits = { | |
'1': /O.*N.*E/, | |
'2': /T.*W.*O/, |