Skip to content

Instantly share code, notes, and snippets.

@harryxu
harryxu / docker-compose.yml
Last active February 14, 2019 12:14
docker mysql
version: '3.1'
services:
db:
image: mysql:5.7
restart: always
volumes:
- ./data:/var/lib/mysql
ports:
@harryxu
harryxu / vunzip.php
Created November 14, 2018 10:42
解压vendor.zip
<?php
function extractVendor($rootPath)
{
$vendorArchive = "$rootPath/vendor.zip";
$vendorDir = "$rootPath/vendor";
if (!file_exists($vendorArchive)) {
return "$vendorArchive 文件不存在";
}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
#!/usr/bin/env bash
apigen \
--source ./vendor/laravel \
--source ./vendor/symfony \
--source ./vendor/monolog \
--exclude "*/tests/*" \
--exclude "*/Tests/*" \
--destination ./ldocs/ --title "Laravel Framework 4.1"
@harryxu
harryxu / fontconfig.properties
Created March 23, 2013 06:51
Java字体配置文件,优化了等宽字体与中文。
# @(#)fontconfig.properties 1.5 04/01/28
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
#
# Version
version=1
# Component Font Mappings
@harryxu
harryxu / cnv.sh
Created September 19, 2012 11:13
#!/usr/bin/env bash
CURRENT_PATH=`pwd`
outdir="$CURRENT_PATH/out"
if [[ ! -d $outdir ]]; then
mkdir $outdir
fi
cd "$CURRENT_PATH/origin"
VIDEOS=`find . -name "*"`
@harryxu
harryxu / .vromerc
Created January 8, 2012 07:22
Vromerc
unmap <M-d>
unmap <C-f>
set disablesites=mail.google.com, reader.google.com, localhost, 127.0.0.1
" vim: set ft=vim:
@harryxu
harryxu / gist:1470448
Last active November 20, 2017 18:21
Linux new user
# Create a new user.
adduser username
# Add a existing user to existing group.
# Add existing user tony to ftp supplementary/secondary group with usermod command using -a
# option ~ i.e. add the user to the supplemental group(s). Use only with -G option :
usermod -a -G ftp tony
# Create a new group.
@harryxu
harryxu / change_prefix.sql
Created December 9, 2011 04:50
批量修改MySQL表前缀
-- http://blog.itmem.com/?p=1062
-- @author xueyu
-- @desc modify the prefix of table name in db
-- @example
--
-- use DBNAME;
-- show tables;
-- source ~/change_prefix.sql;
--
-- call change_prefix('old_', 'new_', 'DBNAME');
@harryxu
harryxu / awk.html
Created January 27, 2011 06:14
awk手册
<p>这个手册是我转载的,准备用markdown整理下格式,感觉原来的html太乱了。</p>
<p>TOC是通过python的markdown生成的,<a href="http://www.freewisdom.org/projects/python-markdown/">http://www.freewisdom.org/projects/python-markdown/</a></p>
<pre><code>markdown awk.md &gt; awk.html -x toc
</code></pre>
<p>以下全部内容是从 <a href="http://linuxfire.com.cn/~lily/awk.html">http://linuxfire.com.cn/~lily/awk.html</a> 转载的。</p>
<div id="awktoc">
<div class="toc">
<ul>
<li><a href="#awk">awk 手册</a><ul>