Skip to content

Instantly share code, notes, and snippets.

View stgogm's full-sized avatar
Always at work

Santiago G. Marín stgogm

Always at work
View GitHub Profile
@stgogm
stgogm / logid.cfg
Last active July 8, 2024 14:25
Logid config
devices: ({
name: "Wireless Mouse MX Master 3";
dpi: 1200;
hiresscroll: {
hires: true;
invert: false;
target: false;
};
smartshift: {
on: true;
mongoexport --db <DB> --collection <COLLECTION> --fields <FIELDS> --type=csv --out <OUT> --host <HOST:PORT> --authenticationDatabase admin --ssl --username <USERNAME> --password <PASSWORD>
@stgogm
stgogm / subdomain-regexp.js
Created May 8, 2017 14:50
Replace subdomain regexp
window.location.origin.replace(/^(https?:\/\/)?(.+\.)?([^\.]+\.[^\/]+)\/?.*$/i, '$1new-subdomain.$3');
@stgogm
stgogm / vs-code-keybindings.json
Last active August 9, 2018 14:31
VS Code keyboard shortcuts
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+numpad_divide",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+7",
"command": "-editor.action.commentLine",
@stgogm
stgogm / vs-code-config.json
Last active August 21, 2018 17:14
VS Code settings
{
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.suggestOnTriggerCharacters": false,
"editor.minimap.renderCharacters": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.wordBasedSuggestions": false,
"editor.fontFamily": "'Ubuntu Mono'",
"editor.renderIndentGuides": true,
"editor.lineHeight": 25.88854382,
"editor.minimap.maxColumn": 120,
@stgogm
stgogm / less-to-scss-regexps.js
Last active March 6, 2017 16:58
LESS to SCSS Regexps
var mixinsDef = /\.([\w-]+)\(([\w-;\$\s]*)\)\s+?{/i; // Replace with: @mixin $1($2) {
var mixinsCall = /\.([\w-]+)\(([\w-;\$\s]*)\);/i; // Replace with: @include $1($2);
/**
* Scores a password's strength.
*
* It scores a password according to several factors like character variation,
* repetition and length. The passwords are scored in a numeric point scale that
* varies from less than 0 to 100 and more. A safe password score should be
* considered as 49 points or more.
*
* @param {String} pwd The password string to score.
*
@stgogm
stgogm / mongod.service
Created July 30, 2016 19:37
MongoDB Ubuntu 16.04 Systemd Service
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
Documentation=https://docs.mongodb.org/manual
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
@stgogm
stgogm / convert-video-audio-only.sh
Created May 28, 2016 03:00
Convert the audio stream only of a video to AAC using avconv.
avconv -i $INPUT_FILE -strict experimental -map 0:v -map 0:a -c:a aac -b:a 768k -c:v copy $OUTPUT_FILE
@stgogm
stgogm / person-name-regexp.js
Last active March 14, 2019 16:01
Person's name RegExp
/^([a-z\u00C0-\u02AB'´`]{1,}\.?\s?)([a-z\u00C0-\u02AB'´`]?\.?\s?)+$/i