Skip to content

Instantly share code, notes, and snippets.

View joshschmelzle's full-sized avatar
༼ つ ◕_◕ ༽つ ø

jsz joshschmelzle

༼ つ ◕_◕ ༽つ ø
View GitHub Profile
@joshschmelzle
joshschmelzle / win-clippy.md
Last active December 15, 2016 14:52
Copy win32 command line output to Windows Clipboard

To save the output of a command on the Windows clipboard, add a pipe* (|) operator to your command followed by the clip command.

Examples

dir | clip - copy the listing of current folder contents to the clipboard.

tree | clip - copy a recursive directory structure to the clipboard.

pwd | clip - copy the present working directory to the clipboard.

@joshschmelzle
joshschmelzle / grep-count.md
Created December 20, 2016 14:34
Grep only count occurrences

grep -ro "pattern to find in files" "directory to recursively search" | grep -c "pattern to find in files"

This solution will count all occurrences even if there are multiple on one line.

-r recursively searches the directory

-o will "show only the part of a line matching PATTERN" 

this is what splits up multiple occurences on a single line and makes grep print each match on a new line;

@joshschmelzle
joshschmelzle / Mozilla SSL Configuration Generator
Created December 20, 2016 14:38
Mozilla SSL Configuration Generator
https://mozilla.github.io/server-side-tls/ssl-config-generator/
@joshschmelzle
joshschmelzle / pandoc-pdf-svg.md
Created December 22, 2016 21:07
Using Pandoc with SublimeText3 to Export Markdown+SVG to PDF on win32

Make sure to install inkscape, pip, python and that they are all in your win32 path.

To check installation and version-

  • pip -V
  • python -V
  • pandoc -v
  • inkscape -V

Pandoc.sublime-settings:

@joshschmelzle
joshschmelzle / return external ip.md
Last active February 10, 2017 14:14
Return IP information in JSON regarding your current external ip address

if you're not behind a proxy

curl ipinfo.io

if through proxy

e.g. using -x --- that's a lowercase x

curl -x http://internet.proxy.com:8080 ipinfo.io

@joshschmelzle
joshschmelzle / SNDA65.md
Last active February 18, 2017 01:57
Instructions for fixing the second hands on a SNDA65

If the SNDA65 stop watch hands are not in the "0" (12 o'clock) position, follow the procedure below to set them to the 12 o'clock position.

  1. Pull the crown to second position
  2. Press button "A" for 2 seconds.
  3. Press button "B" to Adjust the minute hand to "0" position
  4. Press button "A" for 2 seconds then press button "B" to adjust secound hand to "0" position
  5. Press crown into normal position.
@joshschmelzle
joshschmelzle / FINDCUSTOMVALUE.js
Created June 8, 2017 00:36
Google Sheets script to return the word at a desired position in a string split by a space.
function FINDCUSTOMVALUE(inpt, pos) {
var array = inpt.split(" ");
return array[pos];
}
@joshschmelzle
joshschmelzle / nginx.conf
Created June 8, 2017 00:44 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
Sub PasteValues() ' ctrl+b
On Error Resume Next
Selection.PasteSpecial xlPasteValues
End Sub
@joshschmelzle
joshschmelzle / show-hidden-files-mac-OS-finder.md
Last active July 9, 2017 01:11
Show hidden files in Mac OS Finder

Open Terminal (found in Finder > Applications > Utilities).

In Terminal, run the following: defaults write com.apple.finder AppleShowAllFiles YES

Hold the Option/alt key, then right click on the Finder icon in the dock and click Relaunch.