layout | author | title | revision | version | description |
---|---|---|---|---|---|
default |
mattmc3 |
Modern SQL Style Guide |
2019-01-17 |
1.0.1 |
A guide to writing clean, clear, and consistent SQL. |
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
# this is inspired by the official ImportDicomFiles.py - however, this is MUCH faster because | |
# it uses multiple workers to dramatically reduce IO bottlenecks | |
# it doesn't re-instantiate the Http() and headers for every file, rather every folder | |
# it does assume the input folders are structured in the orthanc format, e.g. /00/00/0000a8768bd86... | |
# and expects PATH_TO_SYNC to be something like: | |
## "/path/to/orthanc/root/*" for all root folders | |
## "/path/to/orthanc/root/1*" for all folders beginning with 1 | |
## "/path/to/orthanc/root/23" for root folder 23 only |
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 | |
# Use the built-in ipp2ppd tool to create a PPD file for AirPrint | |
# Add icon to PPD (if we can get one) and install the printer | |
# Required printer info | |
readonly PRINTER_IP='XXX.XXX.XXX.XXX' | |
readonly PRINTER_NAME='PRINTER_NAME' | |
readonly PRINTER_DISPLAY_NAME='PRINTER NAME' | |
readonly PRINTER_LOCATION='PRINTER LOCATION' |
In case there's already a DHCP config for netplan for the private IP address:
File: /etc/netplan/50-cloud-init.yaml
Contents:
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
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
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# [email protected] | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
- using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
- using inventory:
127.0.0.1 ansible_connection=local
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
class BooleanValue | |
# https://github.com/rails/rails/blob/master/activemodel/lib/active_model/type/boolean.rb | |
FALSE_VALUES = [ | |
false, 0, | |
"0", :"0", | |
"f", :f, | |
"F", :F, | |
"false", :false, | |
"FALSE", :FALSE, | |
"off", :off, |
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 | |
# This program will uninstall MacKeeper and JustCloud | |
################# | |
### Variables ### | |
################# | |
# Items at the system level to be removed | |
systemItems=( |
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
/* Blink for Webkit and others | |
(Chrome, Safari, Firefox, IE, ...) | |
*/ | |
@-webkit-keyframes blinker { | |
from {opacity: 1.0;} | |
to {opacity: 0.0;} | |
} | |
.blink{ | |
text-decoration: blink; |
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
require 'gollum/frontend/app' | |
require 'digest/sha1' | |
class App < Precious::App | |
User = Struct.new(:name, :email, :password_hash, :can_write) | |
before { authenticate! } | |
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end | |
helpers do |
NewerOlder