Skip to content

Instantly share code, notes, and snippets.

View kronolynx's full-sized avatar
😜

Johann Og kronolynx

😜
View GitHub Profile
@kronolynx
kronolynx / hints.hs
Created October 14, 2021 09:31
Xmonad hints
-------------------------------------------------------------------------
-- Keybinding hints
-------------------------
-- Order displayed
-- Label used for displaying keys
data Label =
ClientLabel
| LayoutLabel
| TagLabel
| ScreenLabel
@kronolynx
kronolynx / factorialRequest.js
Last active September 29, 2021 13:13
Request Factorial office days
{
async function requestDay(id, requestedDay) {
const payload = { "employee_id": id, "finish_on": requestedDay, "start_on": requestedDay, "leave_type_id": 808762 }
const response = await fetch("https://api.factorialhr.com/leaves", {
method: "POST",
credentials: "include",
headers: {
"Content-Type": "application/json"
},
@kronolynx
kronolynx / txt
Last active December 7, 2023 11:30
surfingKeys
// When total of opened tabs exceeds settings.tabsThreshold, omnibar will be used for choosing tabs.
settings.tabsThreshold = 9;
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
api.map('gt', 'T');
// name: Rosé Pine
// author: thuanowa
// license: unlicense
@kronolynx
kronolynx / factorial.js
Last active November 29, 2021 14:46
factorial
/**
* Shift json
* @param {string} clockIn
* @param {string} clockOut
** the string must have the format HH:MM
*/
function getShift(clockIn, clockOut) {
return {
clockIn: clockIn,
clockOut: clockOut
use std::io;
use std::collections::HashSet;
use std::fmt;
macro_rules! parse_input {
($x:expr, $t:ident) => ($x.trim().parse::<$t>().unwrap())
}
/**
* Auto-generated code below aims at helping you parse
use std::io;
fn main() {
if let Ok(inputs) = read_input() {
let min = inputs.split_whitespace()
.flat_map(|x| x.trim().parse::<i32>())
.min_by(|x, y| if x.abs() == y.abs() { y.cmp(&x) } else { x.abs().cmp(&y.abs())})
.unwrap_or(0i32);
println!("{}", min);
};
use std::io;
macro_rules! parse_input {
($x:expr, $t:ident) => ($x.trim().parse::<$t>().unwrap())
}
fn main() {
if let Ok(inputs) = read_input() {
let min = inputs.split_whitespace()
.map(|x| parse_input!(x, i32))
use std::io;
macro_rules! parse_input {
($x:expr, $t:ident) => ($x.trim().parse::<$t>().unwrap())
}
fn main() {
let mut input_line = String::new();
io::stdin().read_line(&mut input_line).unwrap();
let n = parse_input!(input_line, i32); // the number of temperatures to analyse
@kronolynx
kronolynx / keybase.md
Created January 3, 2018 13:22
keybase proof

Keybase proof

I hereby claim:

  • I am kronolynx on github.
  • I am kronolynx (https://keybase.io/kronolynx) on keybase.
  • I have a public key ASByMZrrDi2KGEhwSDYU94ERlhlNrHgN85OyVeOtkspoAwo

To claim this, I am signing this object: