Skip to content

Instantly share code, notes, and snippets.

View asimpson's full-sized avatar

Adam Simpson asimpson

View GitHub Profile
;; -*- 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/"))
;; -*- 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/"))
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<_>>();
;; -*- 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)
(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))))
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();
(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)
(setq dired-recursive-deletes t)
(setq delete-by-moving-to-trash t)
(global-set-key (kbd "s-=") 'text-scale-increase)
(global-set-key (kbd "s--") 'text-scale-decrease)
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)();