Skip to content

Instantly share code, notes, and snippets.

<html>
<head><title>Lists</title>
</head>
<body>
<div id="list">
<h2>testlist</h2>
<p><span id="mytwitter"></span></p>
</div>
<script type="text/javascript">
<!--
<html>
<head><title>Lists</title>
</head>
<body>
<div id="list">
<h2>testlist</h2>
<p><span id="mytwitter"></span></p>
</div>
<script type="text/javascript">
<!--
@altnight
altnight / gist:454554
Created June 27, 2010 02:06
スカンディナヴィア半島
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>スカンディナヴィア半島</title>
</head>
<body>
<div id="header" class="clearfix">
現在時刻: <span id="current_date"></span>
<span id="api_limit"> </span>
@altnight
altnight / gist:1624236
Created January 17, 2012 02:45
リストから任意の型をとりだしてprintする
a = [1,2,3,4.4,5.5,'aaa']
for i in a:
if isinstance(i, float):
print i
@altnight
altnight / togetter_autoread.user.js
Created March 6, 2012 14:37
Togetherの「続きを読む」を自動で展開
// ==UserScript==
// @name auto page more load for toggeter
// @description Togetterの続きを読むを自動的に表示する
// @include http://togetter.com/li/*
// @namespace http://twitter.com/altnight
// @author altnight
// @version 0.0.1
// ==/UserScript==
(function(){
//「続きを読む」の要素を取ってくる
@altnight
altnight / import_this.py
Created November 2, 2013 09:10
「UNIXという考え方」に近い気がする
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
@altnight
altnight / client.py
Created November 2, 2013 10:02
ソケットからやりなおす まずは公式から http://docs.python.jp/2.7/library/socket.html#socket-example
#!/usr/bin/env python
# coding: utf-8
import sys
import socket
HOST = 'localhost'
PORT = 50007
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
@altnight
altnight / playbook.yml
Created May 6, 2014 14:51
ansible playbook for install python 3.4
---
- hosts: 127.0.0.1
connection: local
user: (user)
vars:
tmpdir: "/Users/(user)/tmpfile/python"
name: "Python"
version: "3.4.0"
tasks:
- name: "make dir"
# -*- coding: utf-8 -*-
def parse_input_string(strs):
import shlex
parsed = shlex.split(cmd)
print(parsed)
return parsed
cmd = 'hoge | moge 1 | insert_delimiter ! | whitespace'
parsed = parse_input_string(cmd)
"""
- https://speakerdeck.com/anatoo/phpdexue-buvmxing-zheng-gui-biao-xian-enzinfalseshi-zu-mi
- http://blog.asial.co.jp/1221
"""
import copy
class RegexVMThread(object):
def __init__(self):
self.string_pointer = 0