Skip to content

Instantly share code, notes, and snippets.

View Skycocoo's full-sized avatar

Yuxi Luo Skycocoo

View GitHub Profile
@Skycocoo
Skycocoo / Git_Cheatsheet.md
Last active June 7, 2018 04:13
Git squash commits

merge commits:

git rebase -i HEAD~(# the number of merging commits - 1)

revert changes:

git reflog # or git log -g
@Skycocoo
Skycocoo / Cmake_Cheatsheet.md
Last active January 16, 2019 00:52
Cmake notes for basics & finding packages with cmake modules

Basic setting

cmake_minimum_required(VERSION 3.6)
project(project_name)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++14")
@Skycocoo
Skycocoo / DigitalOcean_Domain_Cheatsheet.md
Last active June 30, 2018 04:56
DigitalOcean - Hosting multiple domains on droplet (with Apache2)
@Skycocoo
Skycocoo / wx_pygame.py
Created June 19, 2018 21:30
Pygame embedded in wxPython; deprecated methods removed
### PYGAME IN WX ###
# A simple test of embedding Pygame in a wxPython frame
#
# By David Barker (aka Animatinator), 14/07/2010
# Patch for cross-platform support by Sean McKean, 16/07/2010
# Patch to fix redrawing issue by David Barker, 20/07/2010
# Second window demo added by David Barker, 21/07/2010
# modified by Yuxi Luo (Skycocoo), 19/06/2018
# removed all deprecated methods to current pygame & wx version
@Skycocoo
Skycocoo / pymongo_init.py
Created July 9, 2018 21:15
Pymongo example (starter code)
# https://realpython.com/introduction-to-mongodb-and-python/
# to connect to mongodb:
# windows:
# cmd: $ "C:\Program Files\MongoDB\Server\4.0\bin\mongod.exe" --dbpath="c:\data\db"
import pymongo
from pymongo import MongoClient
# default port: client = MongoClient('mongodb://localhost:27017')
@Skycocoo
Skycocoo / golang_on_mac.md
Created September 6, 2018 15:14
golang installation on mac with brew

Reference: 1

install golang with brew:

$ brew update
$ brew install golang

setting up PATH environment variable (in ~/.bash_profile):

@Skycocoo
Skycocoo / DigitalOceanDroplet.md
Last active March 27, 2020 17:18
Tips for setting up droplet