Skip to content

Instantly share code, notes, and snippets.

View jedfoster's full-sized avatar

Jed Foster jedfoster

View GitHub Profile
@jedfoster
jedfoster / disableVNC.sh
Created November 29, 2012 17:04 — forked from tiernano/disableVNC.sh
Disable VNC on OSX though Command Line
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
@jedfoster
jedfoster / enableVNC.sh
Created November 29, 2012 17:04 — forked from tiernano/enableVNC.sh
Enable VNC on OSX though the command line
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all

Cursor movement

  • h - move left
  • j - move down
  • k - move up
  • l - move right
  • w - jump by start of words (punctuation considered words) W - jump by words (spaces separate words)
  • e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
  • b - jump backward by words (punctuation considered words) B - jump backward by words (no punctuation)

Vim, Day 1

I've been playing with Vim off and on for more than two years. Well, yesterday I decided that I need to take a more serious approach to learning it.

I have set MacVim (mvim) as my shell editor and as my Git editor, replacing TextMate 2 (mate).

→ echo $EDITOR mvim -f --nomru -c "au VimLeave Gemfile Gemfile.lock axle.rb public views !open -a Terminal"

→ git config --global core.editor

Vim, Day 7

I have found myself using Vim for a lot more than I intended. Last week I thought I would only use it on those few occasions when I needed to jump to a text editor from the command line. One week in, I have changed the default application for XML, SQL, ERB, and ASP—don't ask [shudder]—file types to MacVim. I'll probably change shell scripts and Ruby files soon as well.

TextMate is still my primary editor, mainly because I frequently work with groups of files as a project. While NerdTree helps, the TextMate project model—especially with the [Project+][1] plugin—is very comfortable. And when it comes to the tools we use comfort is a huge factor, arguably even bigger than efficiency. A comfortable coder is usually more efficient than an uncomfortable one.

The main hurdle for me with projects in Vim is the concept of buffers, windows, and tabs, which differs from the TextMate model of tab == file and window == collection of tabs. I'm still trying to wrap my head around it all, but these lin

How to "send" Sass output to your clipboard.

In response to this question on the Sass Google Group I came up with this one-liner to send the compiled CSS to your clipboard.

sass file.scss:file.css && cat file.css | pbcopy

Not sure how useful this is, but there you go.

Introducing Readmore.js

This weekend was supposed to be a marathon coding session.

I have a project that I let sit for too long. Sure, I've been cogitating on it for months, but I haven't made the progress on it that I should have. A week ago I woke up with the "hook"—that one little thing that gives you a foothold on a project—I needed. And with Christmas on a Tuesday, I'd have three full days of uninterrupted coding time. Just what I would need to ramp up and get momentum going into 2013.

Rabbit holes.

This project is a new feature (several, actually) to an app I started many years ago. This time though, I'm using some new tools for the prototyping phase: [Sinatra][1], [Sass][2], and [Toadstool][3]. The latter is a style guide framework that I've been helping to develop. If you've ever developed Project A using Project B as a primary tool, while simultaneously developing Project B, you know how easy it can be to get lost in fixing and improving Project B when you should be focusing on Project

@jedfoster
jedfoster / Interview Questions.md
Last active October 23, 2021 02:59
Interview Questions
  1. What brings you to web development? What's your goal? What's your passion? What wakes you up in the middle of the night?

  2. Tell me about common themes you run into working in the UI. How did you address them?

    • UX/Design changes?
    • What’s difficult, what’s fun?
    • Localization
  3. What do you do to keep up to date with technology (blogs, conferences, etc)?

    • What blogs do you follow?
    • If you could master one technology this year, what would it be?

These are the steps I took to build the gem, install it locally, and then install and run the app in an "existing" project.

git clone git@github.com:Anotheruiguy/toadstool.git
cd toadstool
git checkout gem
gem build toadstool.gemspec 
gem install toadstool --local
cd ../
mkdir Foo

cd Foo/

@jedfoster
jedfoster / unbomb.rake
Last active December 14, 2015 02:59
Strip a BOM from a file.
# $ rake unbomb PATH/TO/FILE
task :unbomb do
file = ARGV.last
string = File.open(file, 'r:utf-8').read().encode!('utf-8')
File.open(file, 'w:utf-8') { |f| f.write string.sub!(/\uFEFF/, '') }
end