Skip to content

Instantly share code, notes, and snippets.

View tdsanchez's full-sized avatar

Toby S tdsanchez

  • Phoenix, AZ, USA
View GitHub Profile
@janinge
janinge / osx-defaults.sh
Created March 31, 2012 20:30
Mac OS X defaults
#!/bin/sh
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain KeyRepeat -int 0.18
defaults write NSGlobalDomain InitialKeyRepeat -int 24
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
defaults write com.adobe.AdobeUpdater.Admin Disable.Update -bool yes
@uson1x
uson1x / hack.sh
Last active February 28, 2024 04:27 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2275613/hack.sh | sh
#
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

#!/bin/bash
# from https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Show full path in Finder title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool YES
# Show the ~/Library folder
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@mattratleph
mattratleph / vimdiff.md
Last active May 9, 2024 03:11 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@fergalhanley
fergalhanley / index.html
Created October 18, 2013 05:43
Use this web page example to turn Google docs into a simple content manager. Create a Google Doc, publish it, copy the public link into this file and copy the file to your server. Voila! You've got a web page that will update whenever you make a change to the Google Doc.
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>
My Page Title
</title>
<meta content="" name="steak" />
<link href="http://www.w3.org/StyleSheets/Core/Modernist" media="all" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script><![endif]-->
@ramondelafuente
ramondelafuente / test_sudo_and_variables.yml
Last active March 17, 2023 23:38
Testing ansible "ansible_ssh_user" and "ansible_user_id" variables with sudo
- name: Testing variables with SUDO=NO
hosts: "*"
sudo: no
tasks:
- name: "PLAYBOOK SUDO=NO, TASK SUDO=NO"
command: whoami
register: whoami_output
sudo: no
- debug: var=whoami_output.stdout
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active April 3, 2024 13:55
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.