Skip to content

Instantly share code, notes, and snippets.

View greymd's full-sized avatar
😉
Nanchatte

Yasuhiro Yamada greymd

😉
Nanchatte
View GitHub Profile
@egisatoshi
egisatoshi / Egison_command_tutorial_ja.md
Last active January 1, 2016 07:24
Egisonコマンドラインチュートリアル

Egisonコマンドラインチュートリアル

式を評価

--evalまたは-eオプションで引数の式を評価できます。 式はシングルクォート(`)で囲みます。

$ egison -e '(take 10 primes)'
{2 3 5 7 11 13 17 19 23 29}
@egisatoshi
egisatoshi / maclaurin-expansion.md
Last active April 14, 2016 06:23
MacLaurin expansion on shell
% egison -T -e '(maclaurin-expansion (cos x) x)'                                        
1
0
(/ (* -1 x^2) 2)
0
(/ x^4 24)
0
(/ (* -1 x^6) 720)
0
@ryotako
ryotako / addb.fish
Last active January 22, 2017 08:35
fishのビルトインコマンドだけでegzactを書く練習
function addb
while read -l line
echo $line
end
if count $argv >/dev/null
echo $argv[1]
end
end
@Neetless
Neetless / mail.go
Last active February 28, 2017 07:59
SMTP mail transfer sample program for gmail and office365.
package main
import (
"bytes"
"errors"
"fmt"
"html/template"
"log"
"net"
"net/mail"
@kuwa72
kuwa72 / lg.zsh
Created March 31, 2017 03:46
Life game(requirements: zsh, egzact. Tested on OSX).
#!/usr/bin/env zsh
FO=$(cat)
X=$(head -n 1 <<<$FO)
YL=$(echo $FO|wc -l|bc)
FF=$((echo $X|tr 1 0;echo $FO;echo $X|tr 1 0)|addl 0\ |addr \ 0)
for L in {1..$YL};do
for C in {1..$(echo $X|awk '{print NF}')}; do
echo $FF | sed -n $L,$((L+2))p | cut -d \ -f $C,$((C+1)),$((C+2)) | xargs | {
read B
if echo $B | grep -q '. . . . 1 . . . .';then
@mikkun
mikkun / BannerGei.txt
Created July 1, 2017 14:24
「第29回シェル芸勉強会 大阪サテライト LT」で使用したスライドのような何か("history -r BannerGei.txt"で読み込んで下さい)
center(){ printf "%*s\n" $(((${#1}+$(tput cols))/2)) "$1"; };tput reset;printf "<?xml?><svg><text font-size='20'>帰ってきたバナー芸"|convert - pbm:-|pbmtoascii;printf "<?xml?><svg><text font-size='20'> +手書きSVG"|convert - pbm:-|pbmtoascii;center 'KUSANAGI Mitsuhisa(@mikkun_jp) 2017年7月1日';center '第29回シェル芸勉強会';center '大阪サテライトLT大会'
tput reset;printf "<?xml?><svg><text font-size='20'>1. 流れる「toilet」"|convert - pbm:-|pbmtoascii
A=$(printf "<?xml?><svg><text font-size='40'>うんこ💩|"|convert - pbm:-|pbmtoascii|sed 's/[^ ]\+$//');:(){ clear;echo "$A";A=$(echo "$A"|sed -r 's/(.)(.*)/\2\1/');sleep .03;:;};:
tput reset;printf "<?xml?><svg><text font-size='20'>2. 回転寿司"|convert - pbm:-|pbmtoascii
D=0;while :;do echo "<?xml?><svg xmlns:xlink='http://www.w3.org/1999/xlink'><rect x='0' y='0' height='90' width='90' style='fill:none;stroke:black'/><path id='C' d='m60,45 a15,15 0 1 1 -30,0 15,15 0 1 1 30,0 z' style='fill:none;stroke:none'/><text transform='rotate($D,45,45)' font-family='IPA明朝' style='font-size:30px;fill:black'><textPath xlin
@mecab
mecab / send-region-to-clipboard.el
Last active July 22, 2017 17:16
Send region to the clipboard via the xterm clipboard integration (PASTE64/OSC52)
(defun send-region-to-clipboard (START END)
;; Place https://github.com/skaji/remote-pbcopy-iterm2/blob/master/pbcopy as `cpbcopy`
(interactive "r")
(let ((infile (make-temp-file "send-region-to-clipboard")))
(write-region (buffer-substring (region-beginning) (region-end))
nil
infile
nil
'nomsg)
(with-temp-buffer
@inage
inage / triangle.rb
Last active November 9, 2017 16:01
三角形
## 三角形
## http://rubyfiddle.com/riddles/6bad3
a = [2, 3, 4, 5, 10]
ans = 0
a.combination(3){|v,j,k|
if k < (v+j)
if ans < (v+j+k)
@GINK03
GINK03 / 食べログEDA.md
Last active October 22, 2019 05:17
食べログEDA

食べログEDA

3.6点の壁は本当にあるのか

スクレイピングのコード

import os
import sys
@yukunlin
yukunlin / sudoku_solver.c
Last active January 26, 2020 14:38
Sudoku solver, gcc sudoku_solver.c -O2 -o sudoku_solver && echo '..6.7......9.....35..163...38...27.6.......8.7.....2596..5.71...5.....3.....218..' | ./sudoku_solver
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "sudoku_solver.h"
int fill(sudokuGrid grid, int row, int column, int entry)
{
for (int i = 0; i < DIMENSIONS; i++) {