- Pull Request to website (March 22, 2018) - https://pagure.io/fedora-websites/pull-request/793
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 { xxh32 } = require('@node-rs/xxhash-win32-x64-msvc'); // change it if you use another platform | |
xxh32('1'); |
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 { Img, HTMLChakraProps } from '@chakra-ui/core'; | |
import NextImage from 'next/image'; | |
import { forwardRef, Ref } from 'react'; | |
type NextImageProps = Parameters<typeof NextImage>[0]; // should be replaced with import from next when it exports its type | |
export type ImageProps = Omit< | |
HTMLChakraProps<'img'>, | |
'src' | 'srcSet' | 'ref' | 'width' | 'height' | 'loading' | 'w' | 'h' // TODO let it work with Chakra width/height props | |
> & | |
NextImageProps; |
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
struct Fibonacci(usize, usize); | |
impl Iterator for Fibonacci { | |
type Item = usize; | |
fn next(&mut self) -> Option<Self::Item> { | |
let second = self.1; | |
self.1 = self.0 + self.1; | |
self.0 = second; | |
Some(self.1) | |
} | |
} |
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 std::io::{stdin, stdout, BufRead, BufWriter, Write}; | |
fn main() { | |
let stdin = stdin(); | |
let mut stdin = stdin.lock(); | |
let stdout = stdout(); | |
let mut stdout = BufWriter::new(stdout.lock()); | |
// your code here | |
} |
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
/// Recursive | |
fn gcd<T>(a: T, b: T) -> T where T: std::ops::Rem<Output = T> + Eq + From<u8> + Copy { | |
if b == T::from(0u8) { | |
a | |
} else { | |
gcd(b, a % b) | |
} | |
} | |
/// Iterated |
Only tested in CP-949.
- This will only work on the codepages below.
- Windows codepages: 874, 1250-1258
- IBM codepages: 437, 737, 775, 808, 850, 852, 855-858, 860-866, 869, 922, 1046, 1124, 1125, 1129, 1133, 1161-116
- Multi-byte: 932, 936, 949, 950
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 { styled as original } from 'linaria/react' | |
import { JSX, ComponentType, FunctionComponent } from 'preact' | |
// | |
// Preact Types | |
// Literally copied from Preact source code. | |
// see https://github.com/preactjs/preact/blob/master/src/index.d.ts | |
// The MIT License (MIT), Copyright (c) 2015-present Jason Miller | |
// ----------------------------------- |
This C code recieves a CSV data from stdin, and returns the result via stdout. You can pipe your data to put and extract both input and output.
- Supports automatic numberic conversion. (decimal only)
- Supports real-time output right from stdout.
- Does not support double quoted items (therefore not RFC 4180 compatiable)
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
[...document.querySelectorAll('table.wikitable.col-7-center td[style="background-color:PowderBlue"]')] | |
.map(e => `'${e.textContent.slice(0, -1)}': { small: ${e.nextElementSibling.textContent.slice(0, -1)}, medium: ${e.nextElementSibling.nextElementSibling.textContent.slice(0, -1)}, ` | |
+ `large: ${e.nextElementSibling.nextElementSibling.nextElementSibling.textContent.slice(0, -1)}, boss: ${e.nextElementSibling.nextElementSibling.nextElementSibling.nextElementSibling.textContent.slice(0, -1)}}`) | |
// https://azurlane.koumakan.jp/Experience |
NewerOlder