Skip to content

Instantly share code, notes, and snippets.

View minikomi's full-sized avatar
🍕
I like pizza

minikomi

🍕
I like pizza
  • Tokyo, Japan
View GitHub Profile
/radius 0 def
/currentgray 1 def
/pagewidth currentpagedevice /PageSize get 0 get def
/pageheight currentpagedevice /PageSize get 1 get def
/incRadius {
/radius radius 6 add def
} def
@minikomi
minikomi / test.ps
Last active August 29, 2015 14:23
hmm
/radius 0 def
/currentgray 1 def
/pagewidth currentpagedevice /PageSize get 0 get def
/pageheight currentpagedevice /PageSize get 1 get def
/incRadius {
/radius radius 8 add def
} def
@minikomi
minikomi / dp206.rkt
Created March 19, 2015 02:36
Daily Programmer #206
#lang racket
(define width 91)
(define height 51)
(define radius 9)
(define test-input #<<GRID
......x...x....x............x............x.................................x...............
.........x...........x...................x.....x...........xx.............x................
...........x.................x.x............x..........................x................x..
......x...x.....................x.....x....x.........x......x.......x...x..................
@minikomi
minikomi / euler.rkt
Created January 23, 2015 05:49
udacity eulerian path
#lang racket
(define (can-have-eulerian-path? adj-hash)
(define vertex-counts (map (λ (adjs) (length adjs)) (hash-values adj-hash)))
(or (andmap even? vertex-counts)
(= 2 (length (filter odd? vertex-counts)))))
(define (find-eulerian-path edges)
(define adj-hash (build-adj-hash edges))
(if (not (can-have-eulerian-path? adj-hash)) #f
@minikomi
minikomi / dijkstra.rkt
Created January 15, 2015 11:54
dijkstra's algorithm
#lang racket/base
(require racket/list)
(define data
'((a b 7)
(a c 9)
(a f 14)
(b c 10)
(b d 15)
@minikomi
minikomi / gui.rkt
Created November 6, 2014 13:27
gui example racket
#lang racket/gui
;;;
;;; WORLD
;;;
(define-struct world (lines))
(define the-world (make-world '((0 . 0) (0 . 300) (250 . 250) (150 . 176) (10 . 4) (280 . 10))))
;;;
@minikomi
minikomi / traverse.purs
Created October 24, 2014 12:21
traverse.purs
let isOdd x = case x % 2 of
0 -> Nothing
_ -> Just x
traverse (\ x -> isOdd x) [3,5,7,9]
-- Just ([3,5,7,9])
sequence $ map (\ x -> isOdd x) [3,5,7,9]
@minikomi
minikomi / index.html
Created September 26, 2014 05:04
daily programmer #181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title></title>
<style>
body{
margin: 0 auto;
width: 960px;
}
@minikomi
minikomi / Scraping\ Rosetta\ Code.ipynb
Created September 18, 2014 04:55
scraping rosetta code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@minikomi
minikomi / slackurlscrape.py
Created September 8, 2014 03:26
get all urls mentioned in a slack channel for dump to txt
import requests
import json
import re
baseurl = "https://slack.com/api/channels.history"
token = "ur_token_plz"
channel = "C029WAA59"
urlregex = re.compile("<(http[s]{0,1}:\/\/.+?)>")
def scrapelinks(latest=""):