A Pen by Johan van Tongeren on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
import socket | |
import struct | |
def get_macaddress(host): | |
""" Returns the MAC address of a network host, requires >= WIN2K. | |
""" | |
# Check for api availability | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import socket | |
def get_ipaddress(): | |
try: | |
return socket.gethostbyname(socket.gethostname()) | |
except Exception, e: | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.connect(("baidu.com",80)) | |
ip = s.getsockname()[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env python | |
# coding: utf-8 | |
import pygame | |
import pygame.camera | |
from pygame.locals import * | |
import time | |
pygame.init() | |
pygame.camera.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import os, re, threading | |
addrs = {} | |
def bin8(n): | |
byte = "{0:08b}".format(n) | |
if len(byte)<8: | |
byte = '0'*(8-len(byte))+byte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//document.body.appendChild(document.createElement('script')).src='http://code.jquery.com/jquery-1.9.1.min.js'; | |
// get content | |
var wl=[]; | |
// Manual page | |
var tl = document.getElementsByClassName("WB_text") | |
for(var i=0;i<tl.length;i++){ | |
wl.push(tl[i].innerText); | |
}; | |
var wb = wl.join('').replace(/http:\/\/t\.cn\/[a-zA-Z0-9]+/g,''); | |
// get time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import curses | |
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN | |
import time | |
import random | |
class Snake(): | |
def __init__(self,length,screen): | |
# left top coordinate (y,x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from "lucasfais":https://gist.github.com/lucasfais | |
h1. Sublime Text 2 - 实用快捷键 (Mac OS X) | |
h2. 打开/前往 | |
| *⌘T* | 前往文件 | | |
| *⌘⌃P* | 前往项目 | | |
| *⌘R* | 前往 method | | |
| *⌘⇧P* | 命令提示 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#coding: utf-8 | |
import sys | |
argvs = sys.argv | |
class syntaxError(Exception): | |
def __init__(self, line): | |
# start with 1 | |
self.line = line+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name doubanFM2NetEase | |
// @namespace http://xavierskip.com/ | |
// @version 0.1 | |
// @description doubanFM searching in netease cloud music | |
// @author xavier skip | |
// @match http://douban.fm/* | |
// @grant none | |
// ==/UserScript== | |
function addGlobalStyle(css) { |
OlderNewer