This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-moz-document url-prefix() { | |
.css-class { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ImageResizer.swift | |
// | |
// Created by Alex Seifert on 18/06/2016. | |
// http://www.alexseifert.com | |
// | |
import Foundation | |
import Cocoa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function updateWordPress { | |
cd $1 | |
wp core update | |
wait | |
wp plugin update --all | |
wait | |
wp theme update --all | |
wait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
expand_func () { | |
OLD_LENGTH=4 # old indentation length | |
NEW_LENGTH=2 # new indentation length | |
unexpand -t $OLD_LENGTH "$1" | expand -t $NEW_LENGTH > "$1.tmp" | |
mv "$1.tmp" "$1" | |
} | |
export -f expand_func |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// View port widths from Bootstrap | |
export const xs = 0; | |
export const sm = 576; | |
export const md = 768; | |
export const lg = 992; | |
export const xl = 1200; | |
export const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); | |
export const isSmDown = (): boolean => vw <= sm; | |
export const isMdDown = (): boolean => vw <= md; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if UIDevice.current.userInterfaceIdiom == .pad { | |
// iPad | |
} | |
else { | |
// iPhone | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UISplitViewController { | |
open override func viewDidLoad() { | |
super.viewDidLoad() | |
self.show(.primary) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
node -e "console.log(require('crypto').randomBytes(256).toString('base64')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
C++ Code Roast Master | |
A script that recursively goes through C++ files and adds sarcastic comments | |
about outdated coding practices. | |
""" | |
import os | |
import re | |
import argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
C++ Code Roast Master (Play-it-Nice Edition) | |
Recursively scans C++ files and adds humorous comments about outdated patterns. | |
Focuses on the code, not the coder. | |
""" | |
import os | |
import re | |
import argparse |