Skip to content

Instantly share code, notes, and snippets.

View tiendq's full-sized avatar
🌳
Code for a Living

Tien Do tiendq

🌳
Code for a Living
View GitHub Profile
@tiendq
tiendq / osx-mongodb-rlimits-fix.md
Created March 7, 2016 14:02 — forked from tamitutor/osx-mongodb-rlimits-fix.md
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)

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 basho/basho_docs#1402)

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

...containing:

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);
// https://davidwalsh.name/essential-javascript-functions
let getAbsoluteUrl = (function () {
let a;
return function (url) {
if (!a)
a = document.createElement('a');
a.href = url;
return a.href;
@tiendq
tiendq / css_debugger.js
Created November 5, 2017 04:27
CSS debugger
[].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
@tiendq
tiendq / VSCode
Last active August 8, 2020 09:29
VSCode.settings.json
/*
Atom One Dark Theme
C/C++
CMake
Debugger for Chrome
DotENV
ESLint
Markdown All in One
vscode-icons
*/
# 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'
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
@tiendq
tiendq / delete_git_submodule.md
Created January 3, 2019 04:28 — 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
@tiendq
tiendq / install-cmake.md
Created April 10, 2019 05:08
Install the latest CMake on Ubuntu