Skip to content

Instantly share code, notes, and snippets.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 8, 2024 21:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jamieparfet
jamieparfet / macOS-mojave-iso.sh
Last active February 11, 2023 19:16
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
// ==UserScript==
// @name Hide Rated R Movies on Feature Films page
// @namespace http://stevespiga.rel.li/
// @version 0.1
// @description try to take over the world!
// @author Steve Spigarelli
// @match https://www.slcolibrary.org/mm/mmmo/newFeatureFilms.htm
// @grant none
// ==/UserScript==
@nrollr
nrollr / nginx.conf
Last active May 11, 2024 16:31
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@jpawlowski
jpawlowski / install_cups+airprint_centos7.md
Last active November 18, 2023 13:17
Install and configure CUPS 2.1.2 on CentOS 7 (LXC running on Proxmox VE) host including AirPrint

Basic setup, e.g. enable ssh

yum -y install epel-release
yum -y upgrade
yum -y install openssh-server net-tools iputils psmisc less which man mc bash-completion bash-completion-extras bash-argsparse bind-utils traceroute htop mtr
echo "export HISTTIMEFORMAT='%F %T  '" > /etc/profile.d/history.sh
echo "export HISTIGNORE='ls -l:pwd:date:'" >> /etc/profile.d/history.sh
echo "export HISTCONTROL=ignoredups" >> /etc/profile.d/history.sh
systemctl enable sshd
systemctl start sshd
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@frozzare
frozzare / template.swift
Last active July 24, 2018 15:54
Example of string replacement in Swift with a dictionary
import Foundation
class Template {
class func render (var str: String, dict: Dictionary<String, String>) -> String {
for (key, value) in dict {
str = str.stringByReplacingOccurrencesOfString("{\(key)}", withString: value)
}
return str
}
@ryanjdew
ryanjdew / find-empty-dirs.xqy
Created January 7, 2013 04:44
This can help you to find empty directories if the uri lexicon is enabled in MarkLogic.
xquery version "1.0-ml";
let $directories-map := (cts:uris('/',('properties','map'),cts:directory-query('/','infinity'))
-
cts:uris('/',('document','map'),cts:directory-query('/','infinity')))
return map:keys($directories-map)[xdmp:estimate(cts:search(fn:collection(),cts:directory-query(.,'infinity'))) eq 0]
@paxtonhare
paxtonhare / check-for-gzip.xqy
Created April 5, 2012 18:32
GZip compression in the browser using MarkLogic 5.0-3 and greater
if (fn:contains(xdmp:get-request-header("Accept-Encoding", ""), "gzip")) then
(: do your gzipping here :)
else
(: don't gzip :)