Skip to content

Instantly share code, notes, and snippets.

@dan-hill
dan-hill / dynamic-fonts.el
Last active August 27, 2020 20:58 — forked from arnab/dynamic-fonts.el
Dynamically adjust fonts in emacs based on screen resolution (Retina vs. Thunderbolt)
;; Gist-ed from in https://github.com/arnab/emacs-starter-kit
(defun set-dynamic-frame-face (frame)
(interactive)
(if window-system
(progn
(if (> (window-width) 2000)
(set-frame-parameter frame 'font "Hack 10") ;; Cinema Display
(set-frame-parameter frame 'font "Hack 12")))))
@dan-hill
dan-hill / Configuration.h
Created March 14, 2019 18:04
Ramps 1.6 Marlin Configuration for Anet A8
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

ID:

Purpose:

Prerequisite:

Steps:

Expected Result

@dan-hill
dan-hill / bug-report.md
Last active August 29, 2016 02:27
Bug report template

Description

[detailed description here]

Screenshot

[screen shots here]

Environment

  • OS: [operating system here]
  • Browser: [browser and version here]
  • Device: [device name here]
<p><strong>What information do we collect?</strong></p>
<p>We collect information from you when you subscribe to our newsletter or fill out a form.</p>
<p>When ordering or registering on our site, as appropriate, you may be asked to enter your: name, e-mail address or phone number. You may, however, visit our site anonymously.</p>
<p>Google, as a third party vendor, uses cookies to serve ads on your site. Google’s use of the DART cookie enables it to serve ads to your users based on their visit to your sites and other sites on the Internet. Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy.</p>
<p><strong>What do we use your information for?</strong></p>
<p>Any of the information we collect from you may be used in one of the following ways:</p>
<p><em>• To contact you following the form you filled out.</em><br>
Your information, whether public or private, will not be sold, exchanged, transferred, or given to any other company for any reason whatsoever
@dan-hill
dan-hill / goAwayKeyboard.swift
Last active August 29, 2015 14:08
Make the keyboard dismiss when tapping outside a textfield.
/* Put in viewDidLoad() */
let tapRecognizer = UITapGestureRecognizer(target: self, action: "handleSingleTap:")
tapRecognizer.numberOfTapsRequired = 1
self.view.addGestureRecognizer(tapRecognizer)
func handleSingleTap(recognizer: UITapGestureRecognizer) {
self.view.endEditing(true)
}
@dan-hill
dan-hill / String.toDouble()
Created October 25, 2014 05:56
Extension to string that adds the toDouble() function with some error checking.
extension String {
func toDouble() -> Double? {
var chars: [Character] = Array(self)
if (chars.filter {$0 == "."}.count > 1) {
return nil
}
var dotIndex: Int? = find(chars, ".")
@dan-hill
dan-hill / .emacs
Created September 8, 2014 03:26
My emacs configuration file.
;; Package Manager
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
;; auto-complete
(require 'auto-complete)
(global-auto-complete-mode t)