Skip to content

Instantly share code, notes, and snippets.

Let’s assume we have an existing project called ‘foo’ and we want to create a fork called ‘bar’.

First, create a new project on GitHub called ‘bar’.

Next, clone foo using the name ‘bar’:

$ git clone git@github.com:YOURNAME/foo.git bar
$ cd bar

Next, edit your Git config file and replace the origin URL with your new URL:

<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="20" columns="98" buffer_rows="500" buffer_columns="0" init_dir="C:\Users\Kevin\Desktop" start_hidden="0" save_size="1" shell="C:\Program Files (x86)\Git\bin\sh.exe --login -i">
<colors>
<color id="0" r="0" g="43" b="54"/>
<color id="1" r="38" g="139" b="210"/>
<color id="2" r="133" g="153" b="0"/>
<color id="3" r="42" g="161" b="152"/>
<color id="4" r="220" g="50" b="47"/>
<color id="5" r="211" g="54" b="130"/>
@Junch
Junch / PostMessage
Created May 25, 2015 06:55
Post a message from Nodejs
// https://nodejs.org/api/http.html#http_http
var http=require('http');
var querystring=require('querystring');
var postData = querystring.stringify({
connection_string: "User Id=xxxx;Password=xxxxxx;Data Source=ussclpecergp-scan.autodesk.com/CERPRD.autodesk.com"
});
var options = {
@Junch
Junch / gist:5d042b956285668f0078
Last active August 29, 2015 14:21
电脑安全
转发来自雪球
由于以前是做过网络安全,所以对于我如何保证自己计算机的安全比较在意,对于自己计算机,我的管理方法如下,希望能够对你有用:
1、 计算机开启普通账户,平时不用超级账户,只有在遇到问题,需要修复系统时才使用超级账户。
2、 不使用大部分国产软件(包括360系、金山系等),当然证券软件和网银软件还是必须使用国产的,这是没有办法的。具体原因不细说。
3、 安装杀病毒软件AVG免费版,定期杀毒,它自动检测电脑上的文件变化,一旦有问题会提示你删除还是保留。
4、 安装防火墙软件COMODO免费版,关闭绝大部分端口,只保留浏览器的上网端口80. 关闭外界主动发起的连接,这样避免从外部来的入侵。
5、 安装防止非授权安装软件CompleteLock免费版,这样一旦有网络上乱七八糟的软件在你电脑上安装时,都可以监控到,用户可以选择阻止,避免电脑被安装很多乱七八糟的东西。
6、 安装KeePass密码管理软件(免费的),不同的账户使用不同的用户名和密码。同时把密码文件(128位加密过的)保存到USB盘上(不保存到电脑上),需要使用时才连接到电脑。
7、 安装CCleaner软件,定期清理电脑垃圾和使用痕迹文件。
@Junch
Junch / Rename files
Created June 9, 2015 15:37
Rename files in a directory
#!/usr/bin/python
import os, sys
import re
regex='^2015.+(\d\d.+)'
for file in os.listdir("."):
m = re.match(regex, file)
if m is not None:
print m.group(1)
@Junch
Junch / iisnode-baseurl.js
Last active August 29, 2015 14:25 — forked from burmisov/iisnode-baseurl.js
Cut off IIS virtual path (base url) from the request url when running with IISNODE
// Cut off IIS virtual path (base url) from the request url when running via IISNODE
// with URL Rewrite
//
// Add "APPL_MD_PATH" to "promoteServerVars" iisnode attribute in web.config
var iisNodeBaseUrl = function () {
return function (req, res, next) {
var appMdPath = req.headers['x-iisnode-appl_md_path'];
if (appMdPath) {
var rootPos = appMdPath.search("/ROOT");
@Junch
Junch / README.md
Created February 3, 2016 03:13 — forked from julianxhokaxhiu/README.md
How to install OSX 10.11 El Capitan on VMWare

How to install OSX 10.11 El Capitan on VMWare

To accomplish this tutorial you already need a previous copy of OSX installed on VMWare Player or Workstation.

0) Acquire a copy of OSX 10.11 El Capitan

First of all you need to acquire a legal copy of OSX El Capitan from the App Store. This tutorial will not cover this part. Sorry :)

1) Unlock OSX option on VMWare

Download the latest version of VMWare Unlocker and use the relative binary to unlock it ( based on your Host OS ).

@Junch
Junch / gtest-install.rst
Created April 28, 2017 10:30 — forked from massenz/gtest-install.rst
Describes how to install and run GTest, a Google framework to conduct unit testing in C++

Build and install Google Test

Download the latest_ (1.7.0) from Google Code (Q: where is it going to live, once GCode shuts down?)

Then follow the primer_, but more to the point, the README (YMMV) Having installed CLion and cmake, this is how I built gtest:

brew install cmake
cd gtest-1.7.0
@Junch
Junch / .gitignore
Created April 28, 2017 11:21 — forked from BennettSmith/.gitignore
gtest-1.7.0 build script
gtest
@Junch
Junch / pdbdump.c
Created July 20, 2017 07:14 — forked from mridgers/pdbdump.c
Small tool to list and query symbols in PDB files.
//------------------------------------------------------------------------------
// pdbdump.c - dump symbols from .pdb and executable files (public domain).
// - to compile; cl.exe /Ox /Zi pdbdump.c
// -
// - Martin Ridgers, pdbdump 'at' fireproofgravy.co.uk
//------------------------------------------------------------------------------
#include <stdio.h>
#include <Windows.h>
#include <DbgHelp.h>