Skip to content

Instantly share code, notes, and snippets.

@tbusser
tbusser / simple-parallax
Last active July 6, 2016 12:55
Parallax effect, see http://codepen.io/tbusser/pen/QEgmmq for an example
(function() {
var imgData = [],
windowHeight = window.innerHeight;
lastScrollPosition = 0;
function getOffset(element) {
var rect = element.getBoundingClientRect();
return {
top: rect.top + document.body.scrollTop,
@tbusser
tbusser / dnsmasq OS X.md
Created December 2, 2016 10:15 — 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 *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
@tbusser
tbusser / iterm2-solarized.md
Created October 9, 2018 08:12 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@tbusser
tbusser / config
Created February 8, 2019 15:10
SSH config for using multiple SSH keys and to prevent OSX from asking for the keyphrase every time
# Default GitHub user
Host github.com
HostName github.com
User git
UseKeychain yes
IdentityFile ~/.ssh/id_rsa_github
IdentitiesOnly yes
Host github.com-rhm
HostName github.com
# @manojampalam - authored initial script
# @friism - Fixed issue with invalid SDDL on Set-Acl
# @manojampalam - removed ntrights.exe dependency
# @bingbing8 - removed secedit.exe dependency
$scriptpath = $MyInvocation.MyCommand.Path
$scriptdir = Split-Path $scriptpath
$sshdpath = Join-Path $scriptdir "sshd.exe"
$sshagentpath = Join-Path $scriptdir "ssh-agent.exe"
@tbusser
tbusser / component.js
Last active March 14, 2024 21:40
Script files for scaffolding a new Vue component using the `script setup` syntax, and a Storybook story file. The scripts `component.js` and `story.js` are expected in a subfolder named `scaffold-templates`.
module.exports = function scaffoldComponent(name) {
return `<script setup lang="ts">
export interface Props {
//Component props go here.
}
/* -------------------------------------------------------------------------- */
const emit = defineEmits<{
// component events go here.