Skip to content

Instantly share code, notes, and snippets.

View RickJP's full-sized avatar
🏠
Working from home

Rick RickJP

🏠
Working from home
View GitHub Profile
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active April 30, 2024 17:23
Online Resources For Web Developers (No Downloading)
@krohne
krohne / countdown.sh
Last active March 1, 2024 20:17
Countdown timer in bash shell script
#!/bin/bash
# $1 = # of seconds
# $@ = What to print after "Waiting n seconds"
countdown() {
secs=$1
shift
msg=$@
while [ $secs -gt 0 ]
do
printf "\r\033[KWaiting %.d seconds $msg" $((secs--))
@dreamyguy
dreamyguy / downloadFile.js
Last active October 26, 2023 14:48
Download response.data as a file, through Blob()
// 'downloadFile.js', written by blending two solutions:
// 'js-download' https://github.com/kennethjiang/js-file-download
// 'Anders Paulsen' https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/
export function downloadFile(data, filename, mime) {
// It is necessary to create a new blob object with mime-type explicitly set
// otherwise only Chrome works like it should
const blob = new Blob([data], {type: mime || 'application/octet-stream'});
if (typeof window.navigator.msSaveBlob !== 'undefined') {
// IE doesn't allow using a blob object directly as link href.
@santisbon
santisbon / Search my gists.md
Last active April 26, 2024 18:39
How to #search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@devxom
devxom / 06.11.2017-wf-el.md
Last active February 5, 2023 12:59
[06.11.2017] WF-eL (Weekly Front-end links) by @devxom
@olivertappin
olivertappin / create-large-file.sh
Last active March 7, 2023 06:36
Create a large file for testing
# Please note, the commands below will create unreadable files and should be
# used for testing file size only. If you're looking for something that has
# lines in it, use /dev/urandom instead of /dev/zero. You'll then be able to
# read the number of lines in that file using `wc -l large-file.1mb.txt`
# Create a 1MB file
dd if=/dev/zero of=large-file-1mb.txt count=1024 bs=1024
# Create a 10MB file
dd if=/dev/zero of=large-file-10mb.txt count=1024 bs=10240
@IQAndreas
IQAndreas / caesar-cipher.sh
Last active August 30, 2023 09:39
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active April 14, 2024 14:27
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@philcryer
philcryer / gitrc
Last active May 5, 2020 00:00
This .gitrc activates when you're in a directory that is a git repo. It tells you the branch you're on, with color handling of the bash prompt according to the branch/status. For example, the prompt would look like this: [~/foo](master) $ with (master) colored GREEN, until you've added a file to the repo, but not committed it, then it will turn …
#!/bin/bash
#
# Set your bash prompt according to the branch/status of the current git repository.
#
# One-line install:
# curl https://gist.github.com/philcryer/5066010/raw/784e1e4c9df5289fe6f922fb6d122461d374758c/gitrc -o ~/.gitrc; echo "source ~/.gitrc" >> ~/.profile; source ~/.profile
#
# Originally forked from http://gist.github.com/31934 then modified liberally.
#
@aponxi
aponxi / sql-mongo_comparison.md
Last active February 21, 2024 11:56
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.