Skip to content

Instantly share code, notes, and snippets.

View x5lcfd's full-sized avatar
:octocat:
coding.

x5lcfd x5lcfd

:octocat:
coding.
View GitHub Profile
@x5lcfd
x5lcfd / delete_git_submodule.md
Created October 31, 2018 12:12 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@x5lcfd
x5lcfd / nginxproxy.md
Created November 14, 2018 23:29 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@x5lcfd
x5lcfd / psvn.bat
Created November 27, 2018 07:46
svn effective tool(Windows).
@echo off
REM OpCode[update/commit/revert]
set Arg1=%1
REM TargetPath[work path,...]
set Arg2=%2
set WorkPath1=
set WorkPath2=
@x5lcfd
x5lcfd / hanzi.css
Created December 21, 2018 06:49
typora theme.
html,
body,
#write {
background: #ECEAE8;
font-family: sans-serif;
font-weight: 400;
padding: 0;
margin: 0;
margin-top: 0;
margin-bottom: 0;
@x5lcfd
x5lcfd / log.hpp
Last active January 3, 2019 06:25
A simple log system written in C++.
#pragma once
#include <fstream>
#include <iostream>
#include <memory>
#include <mutex>
#include <string>
#include <sstream>
namespace logging
@x5lcfd
x5lcfd / Reflect.cpp
Last active June 26, 2021 04:50
Simple C++ Reflection
#include "Reflect.h"
namespace reflect
{
struct TypeDescriptor_Int : TypeDescriptor
{
TypeDescriptor_Int()
: TypeDescriptor("int", sizeof(int))
{}
@x5lcfd
x5lcfd / emacs-frame-geometry.el
Created April 27, 2019 08:14
A el script to save&load emacs GUI geometry info.
;; https://wwwtech.de/articles/2011/jul/emacs-restore-last-frame-size-on-startup
(defun save-framegeometry ()
"Get the current frame's geometry and saves to ~/.emacs.d/framegeometry."
(let (
(framegeometry-left (frame-parameter (selected-frame) 'left))
(framegeometry-top (frame-parameter (selected-frame) 'top))
(framegeometry-width (frame-parameter (selected-frame) 'width))
(framegeometry-height (frame-parameter (selected-frame) 'height))
(framegeometry-file (expand-file-name "~/.emacs.d/framegeometry"))

下完了记得改源

在文件 core-configuration-layer.el 里,

;; (defvar configuration-layer--elpa-archives
;;   '(("melpa" . "melpa.org/packages/")
;;     ("org"   . "orgmode.org/elpa/")
;;     ("gnu"   . "elpa.gnu.org/packages/"))
;; ;; '(("spacelpa" . "~/.emacs.d/.cache/spacelpa/"))
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace EngineTools
{
[InitializeOnLoad]
public class ShowFlagsWindow : Editor
{
# Path to startup file
$startup_file = "$([Environment]::GetFolderPath('Startup'))\StartEmacsServer.bat"
# Introduce variable HOME:
# 1. for simplicity
# 2. runemacs.exe expects it to be
#
# %APPDATA% is chosen because runemacs.exe operates there
# https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html#Find-Init
# https://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html#General-Variables