This file contains hidden or 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
;; -*- lexical-binding: t; -*- | |
(setq gc-cons-threshold 64000000) | |
(add-hook 'after-init-hook (lambda () | |
;; restore after startup | |
(setq gc-cons-threshold 800000))) | |
(require 'package) | |
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) |
This file contains hidden or 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
;; -*- lexical-binding: t; -*- | |
(setq gc-cons-threshold 64000000) | |
(add-hook 'after-init-hook (lambda () | |
;; restore after startup | |
(setq gc-cons-threshold 800000))) | |
(require 'package) | |
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) |
This file contains hidden or 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
fn part_two() { | |
let input = "1212"; | |
let p: Vec<_> = input.split("").collect(); | |
let s = p | |
.iter() | |
.filter(|&&x| x != "" && x != "\n") | |
.map(|x| x.parse::<usize>().expect("maps String to usize integer.")) | |
.collect::<Vec<_>>(); |
This file contains hidden or 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
;; -*- lexical-binding: t; -*- | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa-stable" . "https://stable.melpa.org/packages/") t) | |
(package-initialize) | |
(tool-bar-mode -1) | |
(menu-bar-mode -1) | |
(show-paren-mode) | |
(scroll-bar-mode -1) |
This file contains hidden or 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
(defun simpson-org-to-todo() | |
"Convert a line (or region) in an org file to a TODO" | |
(interactive) | |
(let ((heading "") (i 1) (number (read-number "What level?" 1))) | |
(while (<= i number) | |
(setq heading (concat heading "*")) | |
(setq i (+ i 1))) | |
(if (region-active-p) | |
(let ((strings (seq-map (lambda(x) (concat heading " TODO " x)) | |
(split-string (buffer-substring-no-properties (region-beginning) (region-end)) "\n" t)))) |
This file contains hidden or 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 fs = require('fs'); | |
const list = fs.readFileSync('./input.txt').toString().trim().split('\n'); | |
const go = list => { | |
var moves = 0; | |
var position = 0; | |
for (; list[position] !== undefined; moves++) { | |
const pos = position + parseInt(list[position], 10); | |
list[position] = (parseInt(list[position], 10) + 1).toString(); |
This file contains hidden or 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
(defun process(cells) | |
(do ((moves 0 (+ 1 moves)) | |
(position 0)) | |
((null (nth position cells)) (print moves)) | |
(let ((pos (+ (parse-integer (nth position cells)) position))) | |
(setf (nth position cells) (write-to-string (+ (parse-integer (nth position cells)) 1))) | |
(setq position pos)))) | |
(defun start() | |
(let (container) |
This file contains hidden or 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
(setq dired-recursive-deletes t) | |
(setq delete-by-moving-to-trash t) |
This file contains hidden or 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
(global-set-key (kbd "s-=") 'text-scale-increase) | |
(global-set-key (kbd "s--") 'text-scale-decrease) |
This file contains hidden or 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
javascript:(function()%7Bjavascript:(function()%7Bvar%20issueList=jQuery(%22.issue-list%22);var%20count=issueList.children().length;jQuery(%22.count%22).remove();jQuery(%22.search-title%22).prepend(%22%3Cspan%20class='count'%3E(%22+count+%22)%20%3C/span%3E%22);%7D)();%7D)(); |