Skip to content

Instantly share code, notes, and snippets.

View XuToTo's full-sized avatar
☝️
win in action

XuToTo

☝️
win in action
View GitHub Profile
#include "mainwindow.h"
#include <QApplication>
#include "mainwindow.h"
#include <QApplication>
#include <QDesktopWidget>
#include <cstdio>
#include <QMessageBox>
typedef struct{
@XuToTo
XuToTo / CMakeLists.txt
Created August 10, 2020 05:57 — forked from rkitover/CMakeLists.txt
cmake: generate version.h from git
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
INCLUDE(GetGitRevisionDescription)
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD OUTPUT_VARIABLE SHORT_SHA OUTPUT_STRIP_TRAILING_WHITESPACE)
SET(REVISION ${SHORT_SHA} CACHE STRING "git short sha" FORCE)
# only use the plugin to tie the configure state to the sha to force rebuilds
# of files that depend on version.h
include(GetGitRevisionDescription)
@XuToTo
XuToTo / updaterepo.sh
Created September 9, 2017 00:50
更新仓库主分支脚本
echo "######## Current branch: $(git branch | grep -w \*)" &&\
git status &&\
echo -e "\n######## Fetching..." && git fetch &&\
git branch -a &&\
echo -e "\n######## Checkout to [master]" && git checkout master &&\
echo -e "\n######## Pull remote repo..." && git pull && git status && git log --pretty=short -n 5 &&\
echo -e "\n######## Checkout to last branch" && git checkout - && git status && git log -n 3
@XuToTo
XuToTo / Dockerfile
Last active September 9, 2017 00:51
在构建 Docker 镜像时替换系统默认源为阿里云镜像源
ADD sources.list /etc/apt/sources.list
# Install.
RUN \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y build-essential && \
apt-get install -y software-properties-common && \
apt-get install -y byobu curl git htop unzip vim wget && \
rm -rf /var/lib/apt/lists/*