Skip to content

Instantly share code, notes, and snippets.

View ictus4u's full-sized avatar
🚀

Walter Gomez ictus4u

🚀
View GitHub Profile
@ictus4u
ictus4u / mongodb_cheat_sheet.md
Created September 29, 2020 22:58 — forked from bradtraversy/mongodb_cheat_sheet.md
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

{
"$schema": "https://json.schemastore.org/resume",
"basics": {
"name": "Walter Gómez",
"label": "Senior Software Developer",
"image": "",
"url": "",
"summary": "18+ years experienced software developer. Computer scientist with a problem-solving mindset. I've mastered different development stacks, with the complement of a computer networking background. I've been researcher, deputy lecturer, and IT consultant. I've leaded development teams, and played different roles for the sake of the best team performance. Committed to the product success & customer satisfaction. ",
"location": {
"address": "Cuba",
@ictus4u
ictus4u / style.11ty.js
Created November 11, 2020 10:59 — forked from liamfiddler/style.11ty.js
Simple SCSS pipeline for 11ty
const util = require('util');
const sass = require('sass'); // `npm i -D sass`
const renderSass = util.promisify(sass.render);
const inputFile = '_includes/style.scss'; // the path to your main SCSS file
const outputFile = 'style.css'; // the filename you want this template to be saved as
module.exports = class {
data() {
return {
permalink: outputFile,
@ictus4u
ictus4u / whatsappp-this-number.js
Last active May 12, 2021 16:45
Bookmarklet for sending WS message to a selected phone number from the Web.
javascript:(function () {
"use strict";
var defaultCountryCode = '49';
var phoneRegexp = /^\(?(?:00|\+?)?([0-9]{2})?\)?[-. ]?([0-9])[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
var isPhone = function (text) {
return !!text.match(phoneRegexp);
};
var normalizePhone = function (phoneText) {
################## Start Netplan config (renderer: NetworkManager)
# Some useful commands for customisation
# NetConn=$(nmcli device show|grep GENERAL.CONNECTION|head -n1|awk '{print $2}')
# IP=$(nmcli device show|grep IP4.ADDRESS|head -n1|awk '{print $2}')
# GATEWAY=$(nmcli device show|grep IP4.GATEWAY|head -n1|awk '{print $2}')
# sed -i 's/renderer: networkd/renderer: NetworkManager/' //etc/netplan/01-netcfg.yaml
######################################
systemctl start NetworkManager
NIC=$(nmcli device show|grep GENERAL.DEVICE|head -n1|awk '{print $2}')
# Add bookmarks to bash
export MARKPATH=$HOME/.marks
function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
rm -i "$MARKPATH/$1"
@ictus4u
ictus4u / disable-screen-capture-sound.sh
Last active August 7, 2021 03:17
Disable screen-capture sound in Ubuntu 20.04
#!/usr/bin/env bash
sudo mv /usr/share/sounds/freedesktop/stereo/camera-shutter{,-disabled}.oga
sudo mv /usr/share/sounds/freedesktop/stereo/screen-capture{,-disabled}.oga
@ictus4u
ictus4u / effective_modern_cmake.md
Created September 8, 2021 22:52 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@ictus4u
ictus4u / gist:00cd4a3b894f45497a028025b229a777
Last active September 27, 2021 00:37 — forked from berlinbrown/gist:4583728
Simplest Possible Web Crawler with C++
//============================================================================
// Name : OctaneCrawler.cpp
// Author : Berlin Brown (berlin dot brown at gmail.com)
// Version :
// Copyright : Copyright Berlin Brown 2012-2013
// License : BSD
// Description : This is the simplest possible web crawler in C++
// Uses boost_regex and boost_algorithm
//============================================================================
#!/usr/bin/env bash
set -euo pipefail
me=$(basename $0)
usage() {
echo -e "Record checksum for a file list\n" >/dev/stderr
echo -e "Usage: ${me} source_dir target_dir\n" >/dev/stderr
}