Skip to content

Instantly share code, notes, and snippets.

View crosslife's full-sized avatar

404NotFound crosslife

  • Netease Games
  • Hangzhou
View GitHub Profile
@crosslife
crosslife / effective_modern_cmake.md
Created August 25, 2020 03:13 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@crosslife
crosslife / OneNote-to-MD.md
Created June 14, 2019 15:42 — forked from heardk/OneNote-to-MD.md
Convert notes from OneNote into Markdown

Converting One Note to Markdown

This is an example of how to convert notes from OneNote into Markdown to use in other, less annoying Note applications. I am using PowerShell on Windows here, but other shell/scripting environments would work as well. If you want separate .md files, you'll need to export your OneNote pages separately. Exporting a section, or a selection of pages creates a single .docx file.

  • Download and install Pandoc
  • Export each of your note pages to a .docx (Word) format using OneNote export from the File menu
  • Gather all of these .docx files into a directory
  • Open directory in File Explorer
  • Open Powershell from the File Explorer using File -> Open Windows Powersell
  • Run the following command:
@crosslife
crosslife / repo-reset.md
Created January 13, 2019 22:54 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@crosslife
crosslife / convert.py
Last active December 31, 2015 07:39
convert pzd to png
import os
def convertPzdToPng(fileName):
pzdBinFile =open(fileName,'rb')
pzdSize = os.path.getsize(fileName)
pngSize = pzdSize - 33
pzdBinFile.read(32)
outFileName = "outTexture\\" + fileName.split("\\")[-1][0:-4] + ".png"
pngFile =open(outFileName,"wb")
@crosslife
crosslife / gist:5551993
Last active December 17, 2015 04:39
简单的校园网IEEE下载模块,输入论文链接中的ID自动尝试登录下载(只在校园网有效)
'''
Created on 2013-5-10
@author: crosslife
'''
from urllib import urlopen
import urllib2
import cookielib
import re
import time
@crosslife
crosslife / IEEESimple
Created May 10, 2013 02:17
简单的校园网IEEE下载模块,输入论文链接中的ID自动尝试登录下载(只在校园网有效)
'''
Created on 2013-5-10
@author: crosslife
'''
from urllib import urlopen
import urllib2
import cookielib
import re
import time
@crosslife
crosslife / confs.py
Created December 6, 2012 08:26
校园网IEEE论文下载系统后台
'''
Created on 2012-3-7
@author: GeZiyang
'''
from urllib import urlopen
import urllib2
import cookielib
import re
import time