Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I wrote like 10 lines of code a week then I sleep.

laixintao

💭
I wrote like 10 lines of code a week then I sleep.
View GitHub Profile
@mrluanma
mrluanma / README.md
Last active Aug 1, 2017
使用 requests + concurrent.futures 并发的访问 HTTP 服务示例
View README.md
$ python t.py
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): example.net
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (2): example.net
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (3): example.net
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (4): example.net
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (5): example.net
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (6): example.net
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (7): example.net
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (8): example.net
@ficapy
ficapy / img_upload.py
Last active Apr 9, 2018
当做图床使用,读取粘贴板的图像保存上传,完成后将url地址写入到剪贴板
View img_upload.py
#!/usr/local/bin/python2
# -*- coding: utf-8 -*-
# Author: Ficapy
# Create: '16/1/1'
import datetime
import os
import sys
import atexit
import requests
View mindmap.dot
digraph {
思维导图 -> { OmniGraffle XMind dot };
OmniGraffle -> { 排版糟糕 单调 贵 };
XMind -> { 排版不错 主题好看 中文输入很麻烦 };
dot -> { 很强大 灵活 不适合现场演示 };
}
@NicolasT
NicolasT / Jobsteps.hs
Created Nov 9, 2012
Workflow Definition DSL
View Jobsteps.hs
{-# LANGUAGE FlexibleContexts #-}
module Jobsteps (
createDiskClone
, exposeISCSI
, createMachine
, startMachine
, runJob
) where
View djanog-celery-and-redis-on-osx-lion.md

Django-celery + Redis notes

Installation and Setup

  1. Install redis on OSX (10.7) Lion I used:

     $ brew install redis
    
  2. In the project and virtualenv I wanted to use django-celery in I installed the following.

@numberoverzero
numberoverzero / run_scheduled.py
Last active Feb 16, 2020
00.async.periodic.rst
View run_scheduled.py
import asyncio
import functools
import json
import secrets
import aiohttp
from concurrent.futures import ALL_COMPLETED
@jhjguxin
jhjguxin / git_diff.md
Created Aug 6, 2012
Git diff 比较不同版本的差异
View git_diff.md

Git 比较不同版本文件差异的常用命令格式:

git diff                                       查看尚未暂存的文件更新了哪些部分

git diff filename 查看尚未暂存的某个文件更新了哪些

git diff –cached                    查看已经暂存起来的文件和上次提交的版本之间的差异

git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
@anvaka
anvaka / top-github.md
Last active Feb 3, 2021
Top GitHub users by total number of stars
View top-github.md

I was playing with GitHub Archive recently. Out of curiosity I ran this query:

SELECT COUNT(repository_owner) as totalStars, repository_owner
FROM [githubarchive:github.timeline] 
WHERE type = 'WatchEvent'
GROUP BY repository_owner
ORDER BY totalStars DESC
LIMIT 1000
@un1t
un1t / django-script.py
Created Feb 21, 2015
How to run scripts outside django
View django-script.py
# coding: utf-8
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
django.setup()
# write your code here
@riobard
riobard / tcpdump.txt
Last active Apr 8, 2021
Poem lines broadcast by my ISP-provided fiber optical modem
View tcpdump.txt
# My ISP-provided fiber optical modem broadcasts a line of a poem every ten seconds. Here's the tcpdump of the complete poem.
# The optical modem is made by Shanghai Nokia-Bell Co.,Ltd and its model number is G-140W-UD. It's provided by my ISP, China Unicom in Shenzhen.
$ tcpdump -i vlan10 ether proto 0x8300
15:59:00.720301 00:00:00:00:00:12 (oui Ethernet) > Broadcast, ethertype Unknown (0x8300), length 72:
0x0000: 0000 0000 e4ea 8386 d93c 5468 6520 6461 .........<The.da
0x0010: 7920 4920 6c6f 7374 206d 7920 7665 7279 y.I.lost.my.very
0x0020: 2066 6972 7374 2074 6f6f 7468 2c00 0000 .first.tooth,...
0x0030: 0000 0000 0000 0000 0000 ..........
15:59:10.740778 00:00:00:00:00:12 (oui Ethernet) > Broadcast, ethertype Unknown (0x8300), length 72: