Skip to content

Instantly share code, notes, and snippets.

@llh911001
llh911001 / index.html
Created November 7, 2015 05:31
contenteditable insert at cursor
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="area" style="width:300px;height:300px;" onblur="onDivBlur();" onmousedown="return cancelEvent(event);" onclick="return cancelEvent(event);" contentEditable="true" onmouseup="saveSelection();" onkeyup="saveSelection();" onfocus="restoreSelection();"></div>
<script type="text/javascript">
@llh911001
llh911001 / git-gc.sh
Last active September 26, 2015 01:58
Really delete loosed files in git repo
git filter-branch --tag-name-filter cat --index-filter 'git rm -r --cached --ignore-unmatch FILE_NAME' --prune-empty -f -- --all
git reflog expire --expire=now --all
git gc --aggressive --prune=now
@llh911001
llh911001 / .gitconfig
Created July 8, 2015 07:58
git config
[core]
editor = vim
[push]
default = current
[color]
#Use colors in Git commands that are capable of colored output when outputting to the terminal
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
@llh911001
llh911001 / daguerre.py
Created November 29, 2012 10:23
python爬虫,下载草榴贴图区回复数大于等于N的帖子中的图。
#!/usr/bin/env python
# coding: utf-8
import os, sys
import re
import urllib2
import threading
import Queue
host = 'http://184.154.128.246/'