Skip to content

Instantly share code, notes, and snippets.

View Juliet-Selebalo's full-sized avatar

Juliet-Selebalo

View GitHub Profile
@dimitardanailov
dimitardanailov / mongo-commands.md
Last active December 8, 2022 18:38
MongoDB - Commands
# Get documents, where writters are Joel Coen and Ethan Coen.
db.movieDetails.find({ "writters" : ["Joel Coen", "Ethan Coen"] }).count()
# Get documents, where Jeff Bridges is playing leading role.
> db.movieDetails.find({ "actors.0": "Jeff Bridges" }).pretty()
@giraam
giraam / string-to-sha1.java
Last active May 17, 2023 17:55
Hashing a String with SHA1 in Java
import java.io.*;
import java.util.logging.*;
import javax.xml.bind.DatatypeConverter;
/**
* Hashing with SHA1
*
* @param input String to hash
* @return String hashed
*/
@mpapi
mpapi / whenever.sh
Last active March 14, 2023 12:46
A simple shell script that uses inotify in Linux to run shell commands whenever files matching a pattern are changed.
#!/bin/sh
#
# Usage: whenever.sh [pattern] [command]
#
# Executes a command whenever files matching the pattern are closed in write
# mode. "{}" in the command is replaced with the matching filename (via xargs).
# Requires inotifywait from inotify-tools.
#
# For example,