This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Overview: | |
-- This Hammerspoon script is designed to prevent the Citrix Viewer application from logging out due to inactivity. | |
-- It simulates user keystrokes periodically to keep the session active. | |
-- The script performs the following tasks: | |
-- 1. Configures Hammerspoon to use Spotlight for application name searches. | |
-- 2. Clears the console and logs the initiation of a fresh session. | |
-- 3. Defines constants for the application name, time interval between keystrokes, and session limit for reload. | |
-- 4. Implements a logging function that timestamps messages for better traceability. | |
-- 5. Implements a function to simulate keystrokes (right arrow and 'h') in the Citrix Viewer application. | |
-- 6. Implements a function to reload Hammerspoon configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##1 Performs a Wikipedia search on any highlighted text in the web browser window | |
javascript: (function() { | |
function se(d) { | |
return d.selection ? d.selection.createRange().text : d.getSelection() | |
} | |
var s = se(document); | |
for (var i = 0; i < frames.length && (s == null || s == ''); i++) s = se(frames[i].document); | |
if (!s || s == '') s = prompt('Enter%20search%20terms%20for%20Wikipedia', ''); | |
open('https://en.wikipedia.org' + (s ? '/w/index.php?title=Special:Search&search=' + encodeURIComponent(s) : '')).focus(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check version | |
node -v || node --version | |
// list locally installed versions of node | |
nvm ls | |
// list remove available versions of node | |
nvm ls-remote | |
// install specific version of node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is a comprehensive Bash script that automates the process of installing FFmpeg (if not already installed), | |
# then recursively searches through a directory and its subdirectories for .mov files. | |
# For each .mov file found, it uses FFmpeg to convert the file into a compressed .mp4 format, | |
# aiming to significantly reduce the file size with minimal loss in quality. | |
# Function to install ffmpeg | |
install_ffmpeg() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In the Data Section , add the paths as shown below | |
/content/abc | |
/content/xyz | |
/content/qwerty/mno/pwse | |
Upon execution of the following code , This would create a package called "Sample-Package" with the above paths as filters. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SudokuSolver { | |
private static final int GRID_SIZE = 9; | |
private static final int BOX_SIZE = 3; | |
public static void main(String[] args) { | |
int[][] board = { | |
{ 7, 0, 2, 0, 5, 0, 6, 0, 0 }, | |
{ 0, 0, 0, 0, 0, 3, 0, 0, 0 }, | |
{ 1, 0, 0, 0, 0, 9, 5, 0, 0 }, |