Skip to content

Instantly share code, notes, and snippets.

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT/*/shell/runas]
@="root"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT/*/shell/runas/command]
@="cmd.exe /c takeown /f /"%1/" & icacls /"%1/" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f /"%1/" & icacls /"%1/" /grant administrators:F"
@allex
allex / gist:5413867
Created April 18, 2013 15:54
Safely change home directory in cygwin
# http://stackoverflow.com/questions/225764/safely-change-home-directory-in-cygwin
mkpasswd -l -p "$(cygpath -H)" > /etc/passwd
# exclude directory from find . command
find . -name '*.js' | grep -v excludeddir
# for details see man grep, -v sections
@echo off
title 快速配置IE代理
:start
cls
echo.
echo 请选择需要进行的设置(使用报关行版请选择2):
echo.
echo 1) 使用代理 2) 停用代理 3) 删除IE临时文件 Q) 退出
echo.
#!/bin/sh
# ================================================
# Description: List all svn repos url
# Last Modified:
# Author: allex (allex.wxn@gmail.com)
# ================================================
for f in `find . -type d -name ".svn"`; do
cd `dirname $f`;
@allex
allex / x.md
Last active December 18, 2015 06:09

Chrome Fix: Extensions, apps, and user scripts cannot be installed from this web site

==================================

A start-up parameter is making the rounds that you can use alternatively to enable off-site installations in the Chrome browser. For that, you need to start Chrome with the --enable-easy-off-store-extension-install parameter.

$ google-chrome --enable-easy-off-store-extension-install

@allex
allex / gist:5931372
Last active December 19, 2015 09:09 — forked from isaacs/gist:5914757
// Generated via:
// node -e "s=require('http').STATUS_CODES;Object.keys(s).map(function(c){console.log('#define HTTP_STATUS_%d %j',c,c+' '+s[c])})"
#define HTTP_STATUS_100 "100 Continue"
#define HTTP_STATUS_101 "101 Switching Protocols"
#define HTTP_STATUS_102 "102 Processing"
#define HTTP_STATUS_200 "200 OK"
#define HTTP_STATUS_201 "201 Created"
#define HTTP_STATUS_202 "202 Accepted"
#define HTTP_STATUS_203 "203 Non-Authoritative Information"

ubuntu安装五笔输入法(ibus-table-wubi)

IBus-Table是为基于码表的输入法即所谓的形码开发的输入法框架,常见的形码有郑码、五 笔、仓颉、二笔等。

安装如下: apt-get install ibus-table-wubi

开启ibus输入法,按操作提示即可。

@allex
allex / gist:6308762
Created August 22, 2013 15:32
compiler php extenssions for specific php version
allex@allex-tabletop ../ext/mbstring>
cd /Users/allex/Downloads/php-5.5.1/ext/
/usr/local/php5/bin/phpize && ./configure --with-php-config=/usr/local/php5/bin/php-config && make clean && make
make install
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();