Problem solving challenges are fun. They make use of one's problem solving skills and stimulate the programmer's need to challenge themselves.
These 1151159511610110199114
numbers represent a word.
- The word may only contain a-zA-Z_
- The word is of size 8.
In this particular case the secret word was s_ecrets
.
# I have seen several requests from developers trying to populate/repopulate | |
# Alfreds text field with another value. While this is not a native solution, | |
# it's still suffice quite well. | |
# | |
# Explaination | |
# | |
# In order to get access to Alfreds windows, it must be toggled. We can achieve | |
# that by triggering the hotkey specified for Alfred. When toggled, it's as easy | |
# as just setting a new value for the first text field of window 1. | |
# |
Very often, I want to check the latest version of a particular gem on RubyGems.org.
This can be accomplished by doing gem list -r GEM_NAME
.
Unfortunatley, this doesn't always work out well. If I would run gem list -r capistrano
to get the latest version of Capistrano, the list of matches would be quite large.
....
capistrano-zen (0.0.2)
capistrano_auto_multi_install (1.0.6)
capistrano_banner (0.0.4)
Ever so often I want to find a particular process on the system. I've always accomplished this by doing ps -ef | grep PROCESS_NAME
.
Today, I stumpled upon a new command by coincidence. The pgrep
command. By spending a few minutes reading its documentation (man pgrep
) I realized what it's capable of.
Run pgrep -i PROCESS_NAME
to find processes. The -i
flag tells pgrep to perform case insensitive matching.
Run pgrep -ilf PROCESS_NAME
to get long output, including the argument list of the matching process.
From now, this is what I'll be using.
This is some of my thoughts scrambled down in no particular order.
- Establish a solid test suite for current functionality
- Retrieve a SSH config by URL and place it under
~/.ssh/
with proper permissions - Check the ability to integrate with Transmit.app (FTP Client). Transmit read everything inside
~/.ssh/config
but you've to add it as a favorite yourself. I would want to automate that process so thatssh-config set
andssh-config unset
add and remove a Trasmit favorite automatically. - Update codebase for Ruby 1.9+
- Merge standanlone commands
- Add a more configurable interface (colors for highlighting, logging, etc)
A few months ago I read Drew Neil's article about split windows and the project drawer. It's a great article and I strongly recommend you to go ahead and read it.
The article got me spending some time with netrw and sure enough, it replaced NERDTree. One thing that annoyed me though, was its default for deleting directories. Quoting from :help netrw-delete
.
Deleting/removing files and directories involves moving the cursor to the file/directory to be deleted and pressing "D". Directories must be empty first before they can be successfully removed.
This is not a default I'm happy with, but as with everything else in Vim, netrw is customisable. The default command for deleting local directories is rmdir
which requires the directory to be empty. By setting `g:netrw_localrmdir
#!/bin/sh | |
VIM_BUNDLE_DIRECTORY=$HOME/.vim/bundle | |
for dir in $(find $VIM_BUNDLE_DIRECTORY -mindepth 1 -maxdepth 1 -type d); do | |
cd $dir && echo "Updating $(basename $PWD)..." && git pull | |
done |
Seeda.definitions do | |
# A simple seed | |
seed { Category.create! name: "Example Category" } | |
# Seeds can be defined in groups | |
define :users do | |
# Seeds can be named for later reference | |
seed(:john) { User.create! name: "John Doe" } | |
seed(:jane) { User.create! name: "Jane Doe" } | |
end |
function RSpecCommands(bang) | |
if !a:bang | |
noremap <Leader>t :!bundle exec rspec %<CR> | |
noremap <Leader>T :!bundle exec rspec %:<C-R>=line('.')<CR><CR> | |
else | |
silent! nunmap <Leader>t | |
silent! nunmap <Leader>T | |
endif | |
endfunction |