Skip to content

Instantly share code, notes, and snippets.

最近使用pip3总会timeout,试了试下面的镜像站,速度却非常快
https://mirror.tuna.tsinghua.edu.cn/help/pypi/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple
@Junch
Junch / .clang-format
Created July 4, 2018 04:58
A clang format
---
BasedOnStyle: LLVM
IndentWidth: 4
---
Language: Cpp
BreakBeforeBraces: Allman
ColumnLimit: 0
NamespaceIndentation: All
@Junch
Junch / getrepo.js
Created July 3, 2018 09:42
Access the github repos with @octokit/rest.js
const octokit = require('@octokit/rest')();
octokit.authenticate({
type: 'token',
token: 'xxxxxx your token xxxxxxxx'
});
async function paginate (method) {
let response = await method({
owner: 'Junch',
@Junch
Junch / README-Highcharts-Webpack-Babel.md
Created January 4, 2018 07:25 — forked from jon-a-nygaard/README-Highcharts-Webpack-Babel.md
A Highcharts example in use with Webpack and Babel.

A Highcharts example in use with Webpack and Babel.

Install

  1. Download source files
  2. Run npm install to install all dependencies.
  3. Run npm run build to bundle app.js into bundle.js

Open application

  1. Open index.html in a browser.
@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>
@Junch
Junch / .gitignore
Created April 28, 2017 11:21 — forked from BennettSmith/.gitignore
gtest-1.7.0 build script
gtest
@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 / 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 / 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 / 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)