Skip to content

Instantly share code, notes, and snippets.

@mopvhs
mopvhs / replace-zero-width-space.php
Created July 13, 2016 10:14 — forked from ahmadazimi/replace-zero-width-space.php
PHP replace Zero Width Space using preg_replace
<?php
/**
* http://stackoverflow.com/questions/11305797/remove-zero-width-space-characters-from-a-javascript-string
* U+200B zero width space
* U+200C zero width non-joiner Unicode code point
* U+200D zero width joiner Unicode code point
* U+FEFF zero width no-break space Unicode code point
*/
@mopvhs
mopvhs / vm-resize-hard-disk.md
Created November 20, 2015 19:12 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@mopvhs
mopvhs / XPath Helper
Last active August 29, 2015 14:04
随手批量下载网页上的图片
https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl
快捷键:Ctrl-Shift-X
//div[@class='pic']//img//@src
列编辑,加上域名,保存到images.txt
wget -i images.txt
import sys
import os
import zlib
from urllib2 import (build_opener, HTTPPasswordMgrWithDefaultRealm,
HTTPBasicAuthHandler, HTTPDigestAuthHandler, HTTPError, URLError)
from httplib import BadStatusLine
class HTTPHandlerError(Exception):
"""