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
;;; init.el --- Emacs configuration. -*- lexical-binding: t -*- | |
;;; Copyright (C) 2023 Vishesh Yadav | |
;;; Author: Vishesh Yadav <visehsh3y@gmail.com> | |
;; | |
;; Leanest usable emacs config, without using any external packages in emacs29. | |
;;;---------------------------------------------------------------------------- | |
;;; Personal | |
;;;---------------------------------------------------------------------------- |
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 | |
LOOPS=5 #How many times to run each test | |
SIZE=1024 #Size of each test, multiples of 32 recommended for Q32 tests to give the most accurate results. | |
WRITEZERO=0 #Set whether to write zeroes or randoms to testfile (random is the default for both fio and crystaldiskmark); dd benchmarks typically only write zeroes which is why there can be a speed difference. | |
QSIZE=$(($SIZE / 32)) #Size of Q32Seq tests | |
SIZE+=m | |
QSIZE+=m |
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
var emojis = [ | |
'😄','😃','😀','😊','☺','😉','😍','😘','😚','😗','😙','😜','😝','😛','😳','😁','😔','😌','😒','😞','😣','😢','😂','😭','😪','😥','😰','😅','😓','😩','😫','😨','😱','😠','😡','😤','😖','😆','😋','😷','😎','😴','😵','😲','😟','😦','😧','😈','👿','😮','😬','😐','😕','😯','😶','😇','😏','😑','👲','👳','👮','👷','💂','👶','👦','👧','👨','👩','👴','👵','👱','👼','👸','😺','😸','😻','😽','😼','🙀','😿','😹','😾','👹','👺','🙈','🙉','🙊','💀','👽','💩','🔥','✨','🌟','💫','💥','💢','💦','💧','💤','💨','👂','👀','👃','👅','👄','👍','👎','👌','👊','✊','✌','👋','✋','👐','👆','👇','👉','👈','🙌','🙏','☝','👏','💪','🚶','🏃','💃','👫','👪','👬','👭','💏','💑','👯','🙆','🙅','💁','🙋','💆','💇','💅','👰','🙎','🙍','🙇','🎩','👑','👒','👟','👞','👡','👠','👢','👕','👔','👚','👗','🎽','👖','👘','👙','💼','👜','👝','👛','👓','🎀','🌂','💄','💛','💙','💜','💚','❤','💔','💗','💓','💕','💖','💞','💘','💌','💋','💍','💎','👤','👥','💬','👣','💭','🐶','🐺','🐱','🐭','🐹','🐰','🐸','🐯','🐨','🐻','🐷','🐽','🐮','🐗','🐵','🐒','🐴','🐑','🐘','🐼','🐧','🐦','🐤','🐥','🐣','🐔','🐍','🐢','🐛','🐝','🐜','🐞','🐌','🐙','🐚','🐠','🐟','🐬','🐳','🐋','🐄','🐏','🐀','🐃','🐅','🐇','🐉','🐎','🐐','🐓','🐕','🐖','🐁','🐂','🐲','🐡','🐊','🐫','🐪','🐆','🐈','🐩','🐾', |
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
;;;---------------------------------------------------------------------------- | |
;;; Large files | |
;;;---------------------------------------------------------------------------- | |
(defun fast-file-view-mode () | |
"Makes the buffer readonly and disables fontlock and other bells and whistles for faster viewing" | |
(interactive) | |
(setq buffer-read-only t) | |
(buffer-disable-undo) | |
(fundamental-mode) |
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
/* ==UserStyle== | |
@name GitHub Tabs | |
@description Set sensible tabs on GitHub | |
@match *://github.com/* | |
==/UserStyle== */ | |
.tab-size /* override GitHub’s guesses of correct tab size */ { | |
-moz-tab-size: 4 !important; | |
tab-size: 4 !important; | |
} |
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
#lang racket | |
(define (conversation person-a person-b until) | |
(let loop ([until until] | |
[last-message-a ""] | |
[last-message-b ""] | |
[person-a person-a] | |
[person-b person-b]) | |
(let ([next-message-a (string-append "I didnt know that " last-message-a)] | |
[next-message-b (string-append "you didnt know that " last-message-b)]) |
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
#lang racket/base | |
;; bing.rkt | |
;; | |
;; Download Bing's Photo of the Day and set it as current | |
;; wallpaper. Uses hsetroot on Linux. | |
(require net/url | |
racket/file | |
racket/format |
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
(* hacker rank longest palindrome subsequence *) | |
open Core.Std | |
open Option | |
let lcs_palin_naive str = | |
let rec find i j = | |
match (i, j) with | |
| (x, y) when x = y -> 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
open Core.Std | |
type tree = Empty | Node of int * tree * tree | |
let rec largest_bst t = | |
let min_exn (lst:int list) : int = | |
Option.value_exn (List.min_elt lst ~cmp:Int.compare) | |
and max_exn (lst:int list) : int = | |
Option.value_exn (List.max_elt lst ~cmp:Int.compare) | |
in |
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
(define (seq lst last) | |
(if (empty? lst) | |
0 | |
(if (< last (first lst)) | |
(max (add1 (seq (rest lst) (first lst))) | |
(seq (rest lst) last)) | |
(seq (rest lst) last)))) |
NewerOlder