Last Update: May 13, 2019
Offline Version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/ | |
(defun delete-file-and-buffer () | |
"Kill the current buffer and deletes the file it is visiting." | |
(interactive) | |
(let ((filename (buffer-file-name))) | |
(if filename | |
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?")) | |
(progn | |
(delete-file filename) | |
(message "Deleted file %s." filename) |
Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.
As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.
- Generate a ssh key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
sudo update-alternatives --install \ | |
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.6 200 \ | |
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.6 \ | |
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.6 \ | |
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.6 \ | |
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.6 \ | |
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-3.6 \ | |
--slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-3.6 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
py_binary( | |
name = 'generate_compile_command', | |
srcs = [ | |
'generate_compile_command.py', | |
], | |
deps = [ | |
'//third_party/bazel:extra_actions_proto_py', | |
], | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import JSON | |
################### | |
### Write data #### | |
################### | |
# dictionary to write | |
dict1 = Dict("param1" => 1, "param2" => 2, | |
"dict" => Dict("d1"=>1.,"d2"=>1.,"d3"=>1.)) | |
# pass data as a json string (how it shall be displayed in a file) | |
stringdata = JSON.json(dict1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%----------------------------------------------------------------------- | |
%% Make your own quadrille, graph, hex, etc paper! | |
%% Uses the pgf/TikZ package for LaTeX, which should be part of | |
%% any modern TeX installation. | |
%% Email: [email protected] | |
%% Twitter: @mcnees | |
%%----------------------------------------------------------------------- | |
\documentclass[11pt]{article} |
OlderNewer