Skip to content

Instantly share code, notes, and snippets.

View zilongshanren's full-sized avatar
🎯
Focusing

子龙山人 zilongshanren

🎯
Focusing
View GitHub Profile
@zilongshanren
zilongshanren / Vim Ack 技巧
Created February 24, 2014 10:51
Vim Ack 技巧
Ack --type=cpp 'pattern' --ignore-dir=dir path list
Qargs
silent! argdo :%s/(aa)bb(cc)/\1dd\2/ge | argdo update
@zilongshanren
zilongshanren / gist:9290567
Created March 1, 2014 14:32
use ssh key to login a server without a password prompt
1.use the root user and passwd to login the remote server
2.ssh-keygen -t rsa
3.scp [-p port] ~/.ssh/id_rsa.pub yourremoteserver:/tmp
4.switch to the server
5.touch ~/.ssh/authorized_keys
6.cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
7.reload ssh
8.quit your server and run ssh [-p port] user@remoteserver
@zilongshanren
zilongshanren / Verify cocos2d-x android env
Last active August 29, 2015 13:57
A batch file to verify the state of the android development with cocos2d-x
@echo off
setlocal EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
)
rem Prepare a file "X" with only one dot
<nul > X set /p ".=."
::call :color 1a "a" 1a is green
@zilongshanren
zilongshanren / gist:9680474
Created March 21, 2014 06:06
install flake8 on macos
pip install flake8
报错:
SSLError: The read operation timed out
解决方案:
https://github.com/pypa/pip/issues/829
http://stackoverflow.com/questions/9847470/pip-search-django-produces-time-out-error
@zilongshanren
zilongshanren / send-pr-by-command-line
Created March 26, 2014 06:08
使用命令行发pull request
http://hub.github.com/
# while on a topic branch called "feature":
$ git pull-request
[ opens text editor to edit title & body for the request ]
[ opened pull request on GitHub for "YOUR_USER:feature" ]
# explicit title, pull base & head:
$ git pull-request -m "Implemented feature X" -b defunkt:master -h mislav:feature
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
# See original post at http://stackoverflow.com/questions/822404/how-to-set-up-cmake-to-build-an-app-for-the-iphone
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0015 NEW)
cmake_policy(SET CMP0016 NEW)
project(test)
set(NAME test)
@zilongshanren
zilongshanren / sim-run.sh
Last active April 8, 2016 08:08 — forked from shazron/sim-run.sh
scripts for building iphone simulator libs
#!/bin/bash
#
# Build and iPhone Simulator Helper Script
# Shazron Abdullah 2011
#
# WARN: - if your .xcodeproj name is not the same as your .app name,
# this won't work without modifications
# - you must run this script in where your .xcodeproj file is
PROJECTNAME=$1
@zilongshanren
zilongshanren / generate-random
Last active April 8, 2016 07:56
a helper program to generate random numbers
import xlwt
import random
import numpy
import json
import statistics
ezxf = xlwt.easyxf
sampleCount = 10
@zilongshanren
zilongshanren / spidermonkey-ios.sh
Created September 29, 2014 05:38
build spidermonkey on ios
#!/bin/sh
## this script is supposed to be run one directory below the original configure script
## usually in build-ios
MIN_IOS_VERSION=4.3
IOS_SDK=7.1
LIPO="xcrun -sdk iphoneos lipo"
STRIP="xcrun -sdk iphoneos strip"