Skip to content

Instantly share code, notes, and snippets.

@tleish
tleish / dnsmasq OS X.md
Last active April 16, 2024 20:29 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@tleish
tleish / brew-dnsmasq.md
Created April 16, 2024 20:26 — forked from davebarnwell/brew-dnsmasq.md
install dnsmasq with brew

Install dnsmasq and configure for *.dev.local domains

$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf

Reload configuration and clear cache

# Copy the daemon configuration file into place.
$ sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/

$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

@tleish
tleish / what-forces-layout.md
Created September 27, 2021 22:44 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@tleish
tleish / ruby_gems_age.rb
Created August 15, 2019 21:43 — forked from borama/ruby_gems_age.rb
A script that collects and prints info about the age of all ruby gems in your project, see https://dev.to/borama/how-old-are-dependencies-in-your-ruby-project-3jia
#!/bin/env ruby
#
# Collects info about the age of all gems in the project
#
require "json"
require "date"
# Dir.chdir '...'
bundle = `bundle list`
@tleish
tleish / benchmark.rb
Created March 11, 2017 21:52 — forked from gwilczynski/benchmark.rb
Please don’t hate OpenStruct
require 'benchmark'
require 'benchmark/ips'
require 'ostruct'
require 'active_model'
BillingAddressStruct = Struct.new(:street, :city, :zipcode, :country, :state)
BillingAddressOpenStruct = OpenStruct
BillingAddressStructFromHash = Struct.new(:street, :city, :zipcode, :country, :state) do
@tleish
tleish / lds-tools-web-services.txt
Last active August 4, 2018 22:28 — forked from coolaj86/lds-tools-web-services.txt
A clone of http://tech.lds.org/wiki/LDS_Tools_Web_Services just in case it ever gets taken down #lds
A clone of http://tech.lds.org/wiki/LDS_Tools_Web_Services just in case it ever gets taken down
The LDS Tools Web Services provide common services for LDS Tools applications.
Contents [hide]
1 Web service location
2 Description of Services
2.1 Signin services
3 Configurable Values
3.1 References
@tleish
tleish / mysql_backup.sh
Last active April 24, 2024 13:00
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am