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
#!/usr/bin/env bash | |
# 1. Search for text in files using Ripgrep | |
# 2. Interactively narrow down the list using fzf | |
# 3. Open the file in Vim | |
IFS=: read -ra selected < <( | |
rg --color=always --line-number --no-heading --smart-case "${*:-}" | | |
fzf --ansi \ | |
--delimiter : \ | |
--preview 'bat --color=always {1} --highlight-line {2}' |
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
(let ((random (loop with max = 500 | |
for i from 0 to max | |
collect (random max)))) | |
(loop for i in random | |
counting (evenp i) into evens | |
counting (oddp i) into odds | |
summing i into total | |
maximizing i into max | |
minimizing i into min | |
finally (format t "Stats: ~A" |
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
from itertools import combinations | |
# find points in a line WITHOUT GRAPHING. | |
# seems only iterating? | |
points = [(1, 6), (3, 5), (-1, 4), (2, 4), (2, 3), (4, 3), (0, 2), (4, 2), (1, 1), (-4, 0), (3, 0), (-2, -1), (6, -1)] | |
def check_colinear(pairs): | |
(p1x, p1y), (p2x, p2y), (p3x, p3y) = pairs | |
return p1x * (p2y - p3y) + p2x * (p3y - p1y) + p3x * (p1y - p2y) == 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
/* https://gist.github.com/wenliang/bd4a95195d4e058a4db7f129dace3345 */ | |
span.task_closed { | |
text-decoration: none; | |
color: #666; | |
font-size: 13px; /* Smaller than the text */ | |
} | |
pre code{ | |
background-color: #3b6f47; |
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 | |
for this_mind in $* | |
do | |
this_json=${this_mind/mind/json} | |
unzip -c ${this_mind} map.json | tail -n +3 > ${this_json} | |
echo ${this_json} | |
python mm2opml.py ${this_json} | |
done |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
This script will read a data file, | |
and remind you with the method you have configed, | |
if certain day is approaching. | |
It is inspired by the website http://jiyiri.com | |
which is a chinese based website. |
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
#! /usr/bin/env python | |
""" | |
This script will analysis matlab files, | |
and generate a dot file for graphviz. | |
@todo accept several matlab code files | |
@todo distinguish functions and scripts | |
@todo think about same name function |