Skip to content

Instantly share code, notes, and snippets.

View Rhernandez513's full-sized avatar

Robert David Hernandez Rhernandez513

View GitHub Profile
'https://www.howtogeek.com/660517/how-to-find-your-windows-10-product-key-using-the-command-prompt/
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
{
// At time of writing, for use with Visual Studio Code Version 1.29.1 and above
//
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
<?php
try
{
$pdo = new PDO('mysql:host=localhost;dbname=company', 'cfn', 'naiman');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES "utf8"');
}
catch (PDOException $e)
{
$error = 'Unable to connect to the database server.';
@Rhernandez513
Rhernandez513 / sendEmail.sh
Last active August 12, 2023 19:31
Simple script to send emails with mailgun api
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -o allexport
source .env
set +o allexport
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "io.h"
#include <iostream>
// GET INPUTS from STDIN
std::vector<std::string> Get_STDIN_Strings(void) {
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
@Rhernandez513
Rhernandez513 / ctags-proj.sh
Last active November 1, 2017 20:10
Scripts in my \~/bin'
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# ctags-proj - A simple script to update ctags recursively up the directory structure
# using .gitignore as the "indicator" for where the project root is
#!/bin/bash
# update_repos - A simple script to update git repos within a directory
# Location where this script is stored in the filesystem
# STARTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# Location of the working directory of the calling shell
PARENTDIR=$PWD
#!/bin/bash
#
# All in one script to setup vim extensions and setup bash(kinda)
#
# By Robert David Hernandez
# http://www.github.com/rhernandez513
#
apt install exuberant-ctags
@Rhernandez513
Rhernandez513 / .bash_aliases
Last active July 27, 2020 23:40
bashrc, bash_aliases, inputrc
# Directory navigation aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias back='cd $OLDPWD'
#misc aliases
alias open='gnome-open'
alias grep='grep -n'