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 get-repo-url (arg) | |
(let* ((remote (if arg "upstream" (nth 2 (s-split "/" (magit-get-tracked-ref))))) | |
(remote-url (magit-get "remote" remote "url")) | |
(fragments (s-split "[:/@]/?/?" (s-chop-suffix ".git" remote-url)))) | |
(concat "http://" (s-join "/" (cdr fragments))))) | |
(defun open-in-repo (arg) | |
(interactive "P") | |
(let* ((url (get-repo-url arg)) | |
(branch (if arg "master" (magit-get-current-branch))) |
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
#include <reg52.h> | |
/* 这两个貌似没用? */ | |
/* #define uint unsigned int */ | |
/* #define uchar unsigned char */ | |
#define FORWARD 1 | |
#define STOP 0 | |
#define BACKWARD 0 |
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
;;; prelude-helm.el --- Helm setup | |
;; | |
;; Copyright © 2011-2014 Bozhidar Batsov | |
;; | |
;; Author: Bozhidar Batsov <[email protected]> | |
;; URL: https://github.com/bbatsov/prelude | |
;; Version: 1.0.0 | |
;; Keywords: convenience | |
;; This file is not part of GNU Emacs. |
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
ace-jump-buffer 20140725.... installed fast buffer switching extension to `ace-jump-mode' | |
ace-jump-mode 20140616.115 installed a quick cursor location minor mode for emacs | |
ace-window 20140721.752 installed Quickly switch windows using `ace-jump-mode'. | |
ack-and-a-half 20130815.... installed Yet another front-end for ack | |
afternoon-theme 20140104.... installed Dark color theme with a deep blue background | |
ag 20140804.... installed A front-end for ag ('the silver searcher'), the C ack replacement. | |
anzu 20140703.... installed Show number of matches in mode-line while searching | |
browse-kill-ring 20140813.... installed interactively insert items from kill-ring | |
bundler 20131213.357 installed Interact with Bundler from Emacs | |
coffee-mode 20140813.210 installed Major mode to edit CoffeeScript files in Emacs |
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
// Numbers | |
// Only one number type, 64-bit floating point, no integers | |
// first class object | |
// .01024e4 | |
// 2.024e+3 | |
// 10.24E2 | |
// 1024E+1 | |
// 1024.e0 | |
// 1024.e0 |
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
// An object is a dynamic collection of properties. | |
// Every property has a key string that is unique within that object. | |
// get: | |
object.name; | |
object[expression]; | |
// set: | |
object.name = value; | |
object[expression] = value; |
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
(defmacro for (var start stop &rest body) | |
(let ((gstop (gensym))) | |
`(do ((,var ,start (1+ ,var)) | |
(,gstop ,stop)) | |
((> ,var ,gstop)) | |
,@body))) | |
(defmacro in (obj &rest choices) | |
(let ((insym (gensym))) | |
`(let ((,insym ,obj)) |
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
(defmacro ntimes (n &rest body) ; wrong | |
`(do ((i 0 (1+ i))) | |
((>= i ,n)) | |
,@body)) | |
(let ((i 10)) ; 10 | |
(ntimes 5 (incf i)) | |
i) | |
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 quicksort (vec l r) | |
(let ((i l) | |
(j r) | |
(p (svref vec (round (+ l r) 2)))) | |
(while (<= i j) | |
(while (< (svref vec i) p) (incf i)) | |
(while (> (svref vec j) p) (decf j)) | |
(when (<= i j) | |
(rotatef (svref vec i) (svref vec j)) | |
(incf i) |
NewerOlder