Skip to content

Instantly share code, notes, and snippets.

View SethCalkins's full-sized avatar

Seth Calkins SethCalkins

View GitHub Profile
@mattclements
mattclements / function.php
Last active May 15, 2025 08:56
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@jonschlinkert
jonschlinkert / open-iterm-from-finder.md
Last active July 11, 2024 21:42
Add an icon to your finder toolbar to open iTerm in the current folder.

Open iTerm from finder

The code and instructions in this gist are from http://peterdowns.com/posts/open-iterm-finder-service.html. I've had to do this a few times and wanted to distill it the basics.

  1. Open Automator
  2. Create an Application
  3. Choose Actions > Utilities > Run Applescript
  4. Paste the contents of open_in_iterm.app into the window.
  5. Save the script somewhere convenient
  6. Find the script, then drag the script onto the Finder window while holding the command key (or in Yosemite, the command + option keys)
@pchhetri
pchhetri / README.md
Last active May 6, 2025 15:07
OS X iMessage (Messages) database merger

OS X iMessage (Messages) database merger

Use it at your own risk! You might end up worse than before. Backup everything beforehand. Twice.

If you have the Messages app setup in multiple Macs with the same Apple ID you may end up with iMessages (or SMS) scattered around all of these Macs. This is because after a certain time the new iMessages (or SMS) recevied will cease to push to devices afer a certain time has elapsed. Thus, if a computer has been offline for some period of time it won't get the new iMessages.

Each Messages instance stores the information in a SQLite database, to consolidate all these databases run the script below. This is where the Messages app stores the SQLite database under ~/Library/Messages, the folder contents will look like as follows:

  • chat.db
@matejskubic
matejskubic / wifipass.bat
Created February 6, 2017 08:40
Windows 10 WiFi password
netsh wlan show profiles
netsh wlan show profiles name="%1" key=clear
@michielboekhoff
michielboekhoff / _sig.js
Created February 27, 2017 09:36
YouTube downloader
_sig = function(H) {
var U = "R3",
m3 = "round",
e3 = "B3",
D3 = "v3",
N3 = "I3",
g3 = "V",
K3 = "toLowerCase",
n3 = "substr",
z3 = "Z",
@whitehotlogic
whitehotlogic / Microsoft-CLI-Notes.md
Last active August 17, 2018 14:47
Generic Microsoft Server + Desktop CLI Troubleshooting Cheatsheet

Microsoft Troubleshooting -- CLI Notes

(for Windows Workstations & Servers)

1. General

2. Networking

3. Task Management

4. Hard Drive Diagnosis / Repair

5. Windows Corruption Diagnosis / Repair

6. Control Panel Applet & MMC Shortcuts

#requires -Version 4.0
<#
Author: Luke Murray (Luke.Geek.NZ)
Version: 0.1
Purpose: Windows Server 2016 Baseline Hardening using DSC per DoD DISA STIG recommendations 22/06/18.
#>
Configuration 'Server2016'
{