Skip to content

Instantly share code, notes, and snippets.

View cympfh's full-sized avatar
🏠
Working from home

/c/ympfh cympfh

🏠
Working from home
View GitHub Profile
@cympfh
cympfh / e-hentai.coffee
Last active August 29, 2015 13:56
[e-hentaiにスクレイピング中にでた警告メッセージ - 座敷牢日誌](http://zashikiro.hateblo.jp/entry/2012/09/27/173402)
#!/usr/bin/env coffee
# vim: set ft=coffee:
cheerio = require 'cheerio'
http = require 'http'
url = process.argv[2]
prefix = process.argv[3] or './'
unless url
console.warn '''usage: ehentai url [prefix]
@cympfh
cympfh / ayame.hs
Created March 8, 2014 09:35
決定木のノードを一つだけ作る
import Data.List
data Ayame = SV | C deriving (Show, Eq)
datum :: [((Int, Int), Ayame)]
datum = [ ((5,4), SV) , ((2,3), C) , ((9,2), SV) , ((31, 39), SV) , ((20, 20), C) ]
main = do
let rule = findRule datum
(left, right) = partition rule datum
// http://pururin.com/browse/330/40/futanari.html
exec = require('execsync');
template =
"http://pururin.com/view/8727/#idx/a-certain-futanari-girls-masturbation-diary-chapter-3_#Idx.html"
for (var i=0; i<26; ++i) {
var idx = '0'+i;
url = template.replace('#idx', '0' + i)
@cympfh
cympfh / dot.sh
Last active August 29, 2015 13:57
#!/bin/bash
ID='12928'
FROM=1
TO=82
PREFIX=./energy/
for i in `seq ${FROM} ${TO}`; do
echo wget -O ${PREFIX}${i}.jpg $(curl http://thedoujin.com/index.php/pages/${ID}?Pages_page=${i} | grep max-width | cut -d '"' -f 2)
done
@cympfh
cympfh / ppm.hs
Created March 20, 2014 19:06
prepare P3 file.< in.ppm > out.ppm
import Control.Monad
import Data.Maybe
import Control.Applicative
import Control.Arrow
import qualified Data.ByteString.Char8 as B
import Text.Printf
readInt :: B.ByteString -> Int
readInt = fst . fromJust . B.readInt
[ { 'words': '5505', 'date': '2014/2/4 01:35:19' },
{ 'words': '5505', 'date': '2014/2/4 00:54:43' },
{ 'words': '5505', 'date': '2014/2/4 00:35:19' },
{ 'words': '5465', 'date': '2014/2/3 23:35:19' },
{ 'words': '5419', 'date': '2014/2/3 23:07:21' },
{ 'words': '5329', 'date': '2014/2/3 22:35:19' },
{ 'words': '5329', 'date': '2014/2/3 22:18:40' },
{ 'words': '5299', 'date': '2014/2/3 21:35:19' },
{ 'words': '5293', 'date': '2014/2/3 21:25:19' },
{ 'words': '5302', 'date': '2014/2/3 20:58:51' },
@cympfh
cympfh / tutorial.rs
Created April 26, 2014 17:25
Fuck the Rust
// http://static.rust-lang.org/doc/0.10/tutorial.html
/*
* rustc 0.11-pre-nightly (a692e9b 2014-04-26 01:16:23 -0700)
* host: x86_64-unknown-linux-gnu
*/
fn main() {
// ただの出力
import Debug.Trace
debug x = trace (show x) x
main = print $ sim "abc" "bcdef"
sim :: String -> String -> Bool
sim xs ys = n > 0
where n = last $ dp xs ys
#!/bin/bash
PREVONDO=0
while true; do
ONDO=`sensors | tail -2 | head -1 | cut -d'+' -f2 | cut -d '.' -f1`
if [[ $PREVONDO > 71 && $ONDO < 72 ]]; then
xdotool mousemove 2000 300 click 3
echo LOW $ONDO
fi
@cympfh
cympfh / coch.vim
Last active August 29, 2015 14:01
2ch viwer
scriptencoding utf-8
" 17, 39 行目は書き換えの必要あり.
" 39行目は、板のタイトルとURLを交互に書いたテキストファイル
" Cochの起動コマンド
com! Coch :call s:Init2ch()
com! -nargs=1 NG :call <SID>AddtoNGs("<args>")
" グローバル変数