Skip to content

Instantly share code, notes, and snippets.

import System.Net
import System.Text
import System.IO
url as string = 'https://www.google.co.jp/'
enc as Encoding = Encoding.GetEncoding('UTF-8')
req as WebRequest = WebRequest.Create(url)
res as WebResponse = req.GetResponse()
st as Stream = res.GetResponseStream()
sr as StreamReader = StreamReader(st, enc)
@utgwkk
utgwkk / lifegame.py
Last active August 29, 2015 13:57
A Lifegame for Python (requires Pygame)
import pygame, sys, random
from copy import deepcopy
pygame.init()
size = (800,450)
white = (255, 255, 255)
color = (30, 30, 180)
fps = 30
screen = pygame.display.set_mode(size)
pygame.display.set_caption('lifegame')
# coding: utf-8
import os
import hashlib
from glob import glob
flist = []
fmd5 = []
dl = []
dirname = './images/'
import tempfile
import sqlite3
import webbrowser
if __name__ == '__main__':
conn = sqlite3.connect('hoge.db')
c = conn.cursor()
tmp = tempfile.mkstemp(prefix='pythontemp_', suffix='.htm')
f = open(tmp[1], 'wt')
b = ''
# coding: utf-8
import os
from PIL import Image
from glob import glob
flist = []
fhist = []
dl = []
dirname = './images/'
import pygame, sys, random
from copy import deepcopy
pygame.init()
size = (800,450)
white = (255, 255, 255)
color = (30, 30, 180)
fps = 30
screen = pygame.display.set_mode(size)
pygame.display.set_caption('lifegame')
@utgwkk
utgwkk / ray-ban-detector.py
Last active August 29, 2015 14:25
レイバン検出するやつ
# -*- coding: utf-8 -*-
# NOTE: use Python 3.
import tweepy
import re
import sys
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
me = 'YOUR_SCREEN_NAME'
@utgwkk
utgwkk / misaToBF.perl
Created July 26, 2015 03:31
Misa→BFコンバートするのほおぉぉぉぉおおぉおおぉぉぉぉっっ☆
#!/usr/bin/perl
use utf8;
sub misaToBF {
$_[0] =~ tr/→~ー←★☆あぁおぉっッ!!??「『」』/>>><<<\+\+\+\+\-\-\.\.,,\[\[\]\]/;
$_[0] =~ s/[^><\+\-\.,\[\]]//g;
return $_[0];
}
my $text = <<"EOF";
ごっ、ごぉおっ、ご~きげんよおぉおおぉおほっ。ほおぉおぉおっ。
@utgwkk
utgwkk / bf.rb
Last active May 24, 2016 08:57
Brainf*ck
# coding: utf-8
# bf.rb
# 入力された文字列を出力する Brainf*ck コードを出力する
def f(num)
if num <= 13 then
return false
end
lst = []
cnt = 0
@utgwkk
utgwkk / html.scm
Last active August 29, 2015 14:26
Show the content of the given host and URL.
; refer the nth element of list)
(define (list-ref lst n)
(cond
((null? lst) "Out of range")
((= 0 n) (car lst))
(else (list-ref (cdr lst) (- n 1)))
)
)
; Read string from input-port