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
set global tabstop 2 | |
set global indentwidth 2 | |
# simulate Vim's autochdir | |
# since we're always running in client mode, since Kakoune doesn't do windows | |
# https://www.reddit.com/r/kakoune/comments/5dgpze/vimlike_autochdir_option | |
set global autochdir true | |
# simulate Vim's expandtab (poorly) | |
map global insert <tab> '<space><space>' | |
# simulate Vim's textwidth (but hardcoded to some 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
diff --git a/src/main.cc b/src/main.cc | |
index 1af5493..c9a17c8 100644 | |
--- a/src/main.cc | |
+++ b/src/main.cc | |
@@ -466,7 +466,8 @@ int run_client(StringView session, StringView init_cmds, UIType ui_type) | |
} | |
catch (disconnected& e) | |
{ | |
- write_stderr(format("{}\ndisconnecting\n", e.what())); | |
+ if (!e.m_graceful) |
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
#!/bin/sh | |
# | |
# Github won't permit files larger than 100MB (https://help.github.com/articles/working-with-large-files); | |
# don't wait to realize this until you try to push a bunch of commits. | |
git diff --cached --name-only | | |
while read file | |
do | |
if [ $(du -m $file |cut -f 1) -ge 100 ] | |
then |
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
" Highlight a word from inside vim. The color is chosen at random but | |
" persisted across sessions. | |
" By Kartik Agaram -- http://akkartik.name -- [email protected] | |
" Experimenting with an idea by Evan Brooks: https://medium.com/p/3a6db2743a1e | |
" Discussion: http://www.reddit.com/r/programming/comments/1w76um/coding_in_color | |
let highlight_file = &viewdir."/highlights" | |
if !filereadable(highlight_file) | |
call system("mkdir -p ".&viewdir) |
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
# doesn't handle vertical lines | |
def (line x0 y0 x1 y1) | |
collect+let steep ((> abs) y1-y0 x1-x0) | |
when steep | |
swap! x0 y0 | |
swap! x1 y1 | |
when (x0 > x1) | |
swap! x0 x1 | |
swap! y0 y1 | |
withs (deltax x1-x0 |
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
map (fn((input expected)) (test "" :valueof qq_expand.input :should be expected)) | |
pair:list 1 ''1 # force paren | |
'(x) | |
''(x) | |
'(,x) | |
'(list x) | |
'(,x ,y) | |
'(list x y) |
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
;; Draft solution of William Tozier's Cargo-Bot problem: | |
;; http://www.vagueinnovation.com/pragmatic_gp/more-on-moving-blocks | |
;; | |
;; Built in a private lisp dialect I've been working on: | |
;; http://github.com/akkartik/wart#readme | |
;; Requires gcc and linux/macos. | |
;; | |
;; Instructions to run tests: | |
;; $ git clone http://github.com/akkartik/wart.git | |
;; $ cd wart |
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
from BeautifulSoup import BeautifulSoup | |
from urllib2 import urlopen | |
url = '/time/magazine/current' | |
while 1: | |
url='http://www.time.com'+url | |
soup = BeautifulSoup(urlopen(url)) | |
print url, '--', soup.find('time').renderContents() | |
url = soup.find(text='Previous Issue').parent['href'] |
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
# Requirements: g++ | |
# $ git clone http://github.com/akkartik/wart.git | |
# $ cd wart | |
# $ git checkout b5fb9cbccb | |
# $ wget --no-check-certificate https://raw.github.com/gist/1291243/080chessboard.wart | |
# $ wart | |
# Use the 'm' function to make a move. P-K4 is m.5254, etc. m.-1 is undo. | |
# type chessboard | |
# Uppercase is white, lowercase is black |
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
from sys import stdout, stdin | |
from string import atoi | |
import copy | |
p = 'p' | |
r = 'r' | |
n = 'n' | |
b = 'b' | |
q = 'q' | |
k = 'k' |