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
*Format lines: | |
* awk -i inplace '{printf("%04d00%s\n", NR, substr($0,7,120)) }' main.cbl | |
*Compile and run: | |
* cobc -x main.cbl && ./main | |
IDENTIFICATION DIVISION. | |
PROGRAM-ID. hello. | |
AUTHOR. Julia. | |
DATE-WRITTEN. 2024-04-19. | |
DATE-COMPILED. 2024-04-19. | |
REMARKS. This is a pretty good COBOL program. |
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
000100*Condensed from 01-06 https://www.youtube.com/watch?v=m0HfCx1wg1g | |
000200*AAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBIIIIIIII | |
000300 IDENTIFICATION DIVISION. | |
000400 PROGRAM-ID. hello. | |
000500 AUTHOR. JULIA. | |
000600 DATE-WRITTEN. 2024-04-16. | |
000700 DATE-COMPILED. 2024-04-16. | |
000800 REMARKS. This is a pretty good COBOL program. | |
000900* | |
001000 ENVIRONMENT DIVISION. |
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
000100*AAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBIIIIIIII | |
000150*Format lines: | |
000151* awk -i inplace '{printf("%04d00%s\n", NR, substr($0,7,120)) }' main.cbl | |
000160*Compile and run: | |
000161* cobc -x main.cbl && ./main | |
000200 IDENTIFICATION DIVISION. | |
000400 PROGRAM-ID. hello. | |
000500 AUTHOR. JULIA. | |
000600 DATE-WRITTEN. 2024-04-14. | |
000700 DATE-COMPILED. 2024-04-14. |
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
// Source: | |
// https://github.com/Nicklason/node-tf2-currencies | |
const ONE_REF_SCRAP = 9; | |
// Convert a number in refined to scrap | |
function toScrap(refined) { | |
return Math.round(refined * ONE_REF_SCRAP); | |
} |
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
// A possibly more efficient way to match pluralized strings case-insensitively. | |
// For example matching "burgers" and "burger" with fewer iterations. | |
// Untested | |
fn eq_ignore_ascii_case_with_tail(mut lhs: &str, rhs: &str, tail: char) -> bool { | |
let mut lhs_len = lhs.len(); | |
let rhs_len = rhs.len(); | |
if lhs_len == rhs_len + 1 && lhs.ends_with(tail) { | |
lhs = &lhs[..lhs_len - 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
const Filtered = Symbol('Filtered'); | |
const Break = Symbol('Break'); | |
class CharIterator { | |
constructor(string) { | |
this.string = string; | |
this.index = 0; | |
} | |
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::str::FromStr; | |
use std::marker::PhantomData; | |
use serde::de::{self, Visitor}; | |
pub struct StringOrU32Visitor<T> { | |
marker: PhantomData<T>, | |
} | |
impl<T> StringOrU32Visitor<T> { | |
pub fn new() -> Self { |
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
# Connect remotely from command line | |
psql -h <REMOTE HOST> -p 5432 -U <DB_USER> <DB_NAME> | |
# USE database; | |
\c databasename; | |
# SHOW TABLES; | |
\dt; | |
# SHOW COLUMNS FROM tablename |
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/sh | |
find . -type f -name "*.log*" -delete |
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
/** | |
* Gets the standard deviation from a set of numbers. | |
* @example | |
* const { mean, stdv } = getStandardDeviation([10, 10, 10, 10, 5]); | |
* console.log(mean); // 9 | |
* console.log(stdv); // 2 | |
* @param {[number]} numbers - An array of numbers. | |
* @returns Object containing `mean` and `stdv`. | |
*/ | |
function getStandardDeviation(numbers) { |
NewerOlder