Skip to content

Instantly share code, notes, and snippets.

shutdown.exe /s /f /t 60 /c "Shutting down..."
:: 1 hour - 3600
:: 30 mins - 1800
:: 2 hours - 7200
:: 4 hours - 14400
@userhooke
userhooke / create hidden folder Windows
Created December 30, 2015 01:48
run script and folder "Private" will appear. Put your files in that folder and run script once again - folder will disappear. Run script once again to reveal the folder.
cls
@ECHO OFF
title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
@userhooke
userhooke / nindex.sh
Created August 4, 2017 12:45
Script to produce an index.html file
#!/bin/bash
# nindex.sh - A script to produce an index.html file
touch index.html
echo "<!DOCTYPE html>" >> ./index.html
echo "<html lang="en">" >> ./index.html
echo "<head>" >> ./index.html
echo " <meta charset="UTF-8">" >> ./index.html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@userhooke
userhooke / myman.sh
Last active February 9, 2019 09:28
Very simple bash script to create you own notes on how to use CLI tools
#!/bin/bash
# Very simple bash script to create you own notes on how to use CLI tools
dir=~/myman/.myman/
editor=vi
# clear screen
clear
@userhooke
userhooke / MorningCoffee.html
Created February 9, 2019 09:33
HTML page with buttons to batch open websites
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Morning Coffee</title>
<link rel="stylesheet" href="vendor/tacit.min.css">
</head>
<body>
<script>
const mos = [
@userhooke
userhooke / .vimrc
Last active January 17, 2020 16:13
vim config
"" always use vim instead of vi
set nocompatible
call plug#begin(stdpath('data') . '/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'editorconfig/editorconfig-vim'
call plug#end()
"" identify file types
filetype on
@userhooke
userhooke / language_switch.ahk
Created March 28, 2019 09:55
AHK > Switch input language by pressing CapsLock
; Path to startup folder Windows 10 = C:\Users\${user.name}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetCapsLockState, AlwaysOff
CapsLock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
@userhooke
userhooke / text_expander.ahk
Last active March 28, 2019 10:00
AHK > expand text from abbreviation
; Path to startup folder Windows 10 = C:\Users\${user.name}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Type this abbreviation and hit Tab
::br::