Skip to content

Instantly share code, notes, and snippets.

🙃
Code for a Living

Tien Do tiendq

🙃
Code for a Living
Block or report user

Report or block tiendq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tiendq
tiendq / install-cmake.md
Created Apr 10, 2019
Install the latest CMake on Ubuntu
View install-cmake.md
@tiendq
tiendq / delete_git_submodule.md
Created Jan 3, 2019 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.
View delete_git_submodule.md

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
View remove-git-submodule.sh
This seems to be a more modern version (copied from https://stackoverflow.com/a/36593218/2066118):
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule
View git-aliases.sh
# https://github.com/mjkonarski/oh-my-git-aliases
alias g='git'
alias gst='g status'
# alias gfe='g fetch'
alias gco='g checkout'
# alias gcd='gco develop'
View best-packages.md
@tiendq
tiendq / VSCode
Last active Apr 3, 2019
VSCode.settings.json
View VSCode
/*
Atom One Dark Theme
C/C++
CMake
Debugger for Chrome
DotENV
ESLint
Markdown All in One
vscode-icons
*/
View css_debugger.js
[].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
View getAbsoluteUrl.js
// https://davidwalsh.name/essential-javascript-functions
var getAbsoluteUrl = (function() {
var a;
return function(url) {
if(!a) a = document.createElement('a');
a.href = url;
return a.href;
};
View kilometer-input.js
import React from "react";
const numeral = require("numeral");
const BACKSPACE_KEY = 8, TAB_KEY = 9, ENTER_KEY = 13, NUMBER_0 = 48, NUMBER_9 = 57;
class KilometerInput extends React.Component {
constructor() {
super();
this.keyPressHandler = this.keyPressHandler.bind(this);
@tiendq
tiendq / osx-mongodb-rlimits-fix.md
Created Mar 7, 2016 — forked from tamitutor/osx-mongodb-rlimits-fix.md
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)
View osx-mongodb-rlimits-fix.md

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at https://github.com/basho/basho_docs/issues/1402)

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

...containing:

You can’t perform that action at this time.