Skip to content

Instantly share code, notes, and snippets.

@rajeswari199
rajeswari199 / verifysslcertificate.sh
Last active February 10, 2020 09:09
Outputs the private key validity for the provided SSL certificate.
#!/bin/bash
case $1 in
-[h?] | --help)
cat <<-____HALP
Usage: ${0##*/} [ --help ]
Execute it with the command: ./${0##*/} your_certificate.crt your_private_key.crt
____HALP
exit 0;;
esac
@thetrevorharmon
thetrevorharmon / install-apple-font-tools.sh
Created June 19, 2018 17:36
These commands help you install the Apple Font Tools, since their installer doesn't work on newer versions of macOS.
# Mount the font tools dmg as a volume on your Mac
hdiutil attach ~/Downloads/osxfonttools.dmg
# Navigate into the volume and copy
# the main .pkg file somewhere locally
# so you can manipulate it
cd /Volumes/OS\ X\ Font\ Tools/
pkgutil --expand OS\ X\ Font\ Tools.pkg ~/fontTools && cd ~/fontTools
# If you ls, here's what's in the file
@lopspower
lopspower / README.md
Last active April 26, 2024 07:55
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@cowboy
cowboy / currying-use-case.js
Created January 29, 2015 16:17
JavaScript: I've finally found a use case for currying in JavaScript!
// You can have multiple optional arguments, but only if the arguments
// can be distinguished from one another (in this example, by type)
function optionalUnambiguous(myString, myNumber) {
if (typeof myString === 'number') {
myNumber = myString;
myString = null;
}
if (myString == null) { myString = 'default'; }
if (myNumber == null) { myNumber = 0; }