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 | |
# usage: ./squash-no-error-handling.sh <new-branch-name> | |
# | |
# Expects a list of refs on standard input. One commit will be made | |
# per ref. The last line provided will be the tip of the new branch. | |
# | |
# This version is provided to illustrate the concept without any | |
# error-handling. It is unforgiving against any mistakes -- I strongly | |
# recommend you use the 'squash.sh' script instead! |
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
import java.util.Comparator; | |
import java.util.PriorityQueue; | |
// Write a program that takes in 10 integers via command-line and prints them out in reverse natural order using a PriorityQueue. (this should use a Comparator) | |
public class ReversePriorityQueue | |
{ | |
public class Reverse implements Comparator<Integer> | |
{ | |
public int compare(Integer arg0, Integer arg1) | |
{ |
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 packagelet for figuring out where melpa is. will move point to commit in magit-log buffers. | |
(defun melpautil-where-is-melpa (package &optional force-refresh) | |
(interactive (list (intern (let-alist (magithub-repo) .name)) | |
current-prefix-arg)) | |
(let ((commit (melpautil-commit-for-package package force-refresh))) | |
(unless commit | |
(error "Commit not found")) | |
(setq commit (magit-rev-parse "--short" commit)) | |
(when (derived-mode-p 'magit-log-mode) | |
(goto-char 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; base-uri 'self'; connect-src 'self'; form-action 'self'; img-src data:; script-src 'self'; style-src 'unsafe-inline'"> | |
<meta content="origin" name="referrer"> | |
<title>Server Error · GitHub</title> | |
<style type="text/css" media="screen"> | |
body { | |
background-color: #f1f1f1; |
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
;;; Neat convenience function for working with Elisp's EIEIO objects | |
(defmacro oref* (object &rest slots) | |
"Like `oref', but each slot in SLOTS is applied in sequence. | |
For example, | |
\(oref* obj :inner :property) | |
is equivalent to |
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
(defun *magit-delete-trailing-whitespace-from-file () | |
"Removes whitespace from the current item." | |
(interactive) | |
(save-excursion | |
(magit-visit-item) | |
(delete-trailing-whitespace) | |
(save-buffer) | |
(kill-buffer)) | |
(magit-refresh)) |
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
;; Show a backtrace whenever an error is encountered | |
(defun user-error-to-backtrace (&rest r) | |
(with-current-buffer-window | |
(get-buffer-create "*issue*") | |
#'display-buffer-pop-up-window nil | |
(insert (kill-new (with-output-to-string (backtrace)))))) | |
(mapc (lambda (e) (advice-remove e #'user-error-to-backtrace)) | |
'(user-error error)) | |
(mapc (lambda (e) (advice-add e :before #'user-error-to-backtrace)) |
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 CIDER's nREPL handler | |
2 files changed, 5 insertions(+), 2 deletions(-) | |
project.clj | 3 ++- | |
src/clj/myapp/core.clj | 4 +++- | |
modified project.clj | |
@@ -55,7 +55,8 @@ | |
[ring/ring-mock "0.3.0"] | |
[ring/ring-devel "1.4.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
pdf: | |
pdflatex -recorder word.tex | |
pdflatex word.tex |
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
(defn get-topic-children [topics topic-id] | |
(map first (filter #(= topic-id (:parent (second %))) topics))) | |
(defn get-routes [topics topic-id & [slug-so-far]] | |
(let [children (get-topic-children topics topic-id) | |
newslug (if (= topic-id :root) "" | |
(str slug-so-far "/" (:slug (get topics topic-id))))] | |
(if children | |
(into (if (= topic-id :root) {} {topic-id newslug}) | |
(map #(get-routes topics % newslug) children)) |
NewerOlder