Skip to content

Instantly share code, notes, and snippets.

@wormeyman
wormeyman / target_blank.php
Created December 3, 2020 23:38 — forked from allybee/target_blank.js
Add target="_blank" to external links with pure JavaScript. in WordPRess
add_action( 'wp_footer', function () { ?>
<script>
document.addEventListener("DOMContentLoaded", function () {
// remove subdomain of current site's url and setup regex
var internal = location.host.replace("www.", "");
internal = new RegExp(internal, "i");
var a = document.getElementsByTagName("a"); // then, grab every link on the page
for (var i = 0; i < a.length; i++) {
var href = a[i].host; // set the host of each link
<?php
add_action( 'wp_enqueue_scripts', 'kale_child_enqueue_styles' );
function kale_child_enqueue_styles() {
$parent_style = 'kale-style';
$deps = array('bootstrap', 'bootstrap-select', 'font-awesome', 'owl-carousel');
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' , $deps);
wp_enqueue_style( 'kale-style-child', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version') );
}
#!/usr/bin/env sh
#You may need to enable the Universe Repository
# Last updated 2019-07-17 11:47:49
echo "******************************************************************"
echo "Tools for Ubuntu WSL"
echo "******************************************************************"
echo "Adding Git PPA"
echo "******************************************************************"
sudo add-apt-repository -y ppa:git-core/ppa
echo "******************************************************************"
@wormeyman
wormeyman / OpenWithBrackets.bat
Last active January 19, 2022 20:33 — forked from mrchief/LICENSE.md
Run as administrator, when you right click on a file or folder it gives you the option to open in brackets. When you are done close the cmd window.
@echo off
SET st2Path=C:\Program Files (x86)\Brackets\Brackets.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Brackets" /t REG_SZ /v "" /d "Open with Brackets" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Brackets" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Brackets\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Brackets" /t REG_SZ /v "" /d "Open with Brackets" /f
# netsh advfirewall set currentprofile state off # Firewall Off
# netsh advfirewall set currentprofile state on # Firewall On
'Start The Script
Dim SetWshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set wsc = WScript.CreateObject("WScript.Shell")
Set lnk = wsc.CreateShortcut(wsc.SpecialFolders("desktop") & "\Go-Global.LNK")
'Commands
lnk.targetpath = "C:\Program Files\GraphOn\GO-Global\Client\gg-client.exe"
lnk.arguments = "-h hosted.logoscms.com -c -u " & WshNetwork.UserName & " -p Password"
lnk.description = "DB Access"
lnk.workingdirectory = "C:\Program Files\GraphOn\GO-Global\Client"