Skip to content

Instantly share code, notes, and snippets.

@eiskalteschatten
eiskalteschatten / responsive.ts
Created May 31, 2020
A small script to determine viewport widths based on Bootstrap breakpoints.
View responsive.ts
// 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;
@eiskalteschatten
eiskalteschatten / convert-indendations.sh
Last active Jul 14, 2018
Batch Convert 4-Space Indentations to 2-Space
View convert-indendations.sh
#!/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
@eiskalteschatten
eiskalteschatten / update-wordpress.sh
Created Oct 2, 2016
Update WordPress with a Bash script using WP CLI
View update-wordpress.sh
#!/bin/bash
function updateWordPress {
cd $1
wp core update
wait
wp plugin update --all
wait
wp theme update --all
wait
@eiskalteschatten
eiskalteschatten / ImageResizer.swift
Last active Jan 28, 2019
A function written in Swift to resize an NSImage proportionately
View ImageResizer.swift
//
// ImageResizer.swift
//
// Created by Alex Seifert on 18/06/2016.
// http://www.alexseifert.com
//
import Foundation
import Cocoa
@eiskalteschatten
eiskalteschatten / gist:6390600
Created Aug 30, 2013
Automatic Firefox detection in CSS
View gist:6390600
@-moz-document url-prefix() {
.css-class {
}
}
You can’t perform that action at this time.