Struggling between web 2.0 and plain text
4 stories
·
0 followers

Ben Simon: Library of Congress Images - Amazing Resource, But For What?

1 Share

While reading this post, I was especially impressed that the author was able to juxtapose his modern photograph of Fort Bennett Park and one from the Civil War. Where, after all, does one get such historic photos? Why from the Library of Congress picture search, of course.

A search for Arlington VA brings up 1,418 images and many of them seem quite interesting. Here are few random ones:

And hundreds more. And those are just photos they have on file for my local area. I know they're useful for something - just not sure what yet. (School projects? Stock photos?)

One hack you can use to speed up browsing them. You can visit Google Images and search for keywords site:loc.gov to access many of the images. For example, here's what I see when I search for arlington va site:loc.gov:

So what do you think all these images for useful for?

Read the whole story
mocker
4045 days ago
reply
Prairie Village, KS
Share this story
Delete

Emacs-fu: editing with root-privileges -- once more

2 Shares

We've already discussed editing root-owned files here a few times; it's one of those tasks where in a reflex I still open a terminal and use vi to do the job… the only way to overcome that seems to be to make it really easy to do the same from within my running emacs:

  (defun djcb-find-file-as-root ()
  "Like `ido-find-file, but automatically edit the file with
root-privileges (using tramp/sudo), if the file is not writable by
user."
  (interactive)
  (let ((file (ido-read-file-name "Edit as root: ")))
    (unless (file-writable-p file)
      (setq file (concat "/sudo:root@localhost:" file)))
    (find-file file)))
;; or some other keybinding...
(global-set-key (kbd "C-x F") 'djcb-find-file-as-root)

We could take it one step further still – overload the normal (ido-)find-file with a version that checks the permissions first, and if needed, use the above function to open it. But maybe that is too easy; we should be careful with root-owned files after all.

Read the whole story
mocker
4051 days ago
reply
Prairie Village, KS
Share this story
Delete

ReadyState4 » Blog Archive » My Emacs Magit workflow.

1 Share

I wrote about Magit, the Emacs mode for Git almost two years ago and still use it near-daily since. I love being able to spend most my day within Emacs and not having to drop down to shell to pull or push files. I explained my Magit workflow to a user on Stackoverflow recently, and think it would be helpful to post it here as well for my dear Emacs readers:

Magit screenshot

My flow goes like this.

  1. I start the day at work. I type git diff in command line just to see if I have any uncommitted changes from the previous day (don’t forget to enabled colors!) The reason I do this in command line as apposed to magit is because I’m not in emacs yet.
  2. I either open the uncomitted files in emacs emacs file1 file2 or I open some files I’m about to work on.
  3. I code until I’ve fixed a bug or finished a new feature.
  4. In emacs I type C-c i to open up the Magit status window.
  5. I scroll down to the Changes section and next to each file press tab to see a diff of each changes. I either press s to stage those changes or u to unstage those changes.
  6. Optionally, I can look through diffs code and do the same s and u to stage and unstage sections of the code. Useful if I had some debug code somewhere and want to kill it.
  7. After I’ve confirmed all my changes look good and are staged I type c to open the magit-edit-log. I type my commit message and then type C-c C-c to commit it. Then P to push it. Done!

Note that this sounds like a lot of steps but it becomes quickly natural and the whole process literally takes 30 seconds for me to diff my entire set of changes, stage them, and commit them with a message. All while staying in Emacs. So much easier than dropping down to command line.

Sometimes an error is returned when I do a push via Magit usually caused by new code in the remote repo that I have to pull before I push. In this case F to pull changes then P again to push. Honestly for some reason, instead of pulling through magit, I generally just Ctrl-z in this situation, drop down to shell, git pull, and git push.

And as previously posted, don’t forget to change Magit’s default diff colors!

Leave a Reply

Read the whole story
mocker
4051 days ago
reply
Prairie Village, KS
Share this story
Delete

Ineffective Sorts

1 Comment and 7 Shares
StackSort connects to StackOverflow, searches for 'sort a list', and downloads and runs code snippets until the list is sorted.
Read the whole story
mocker
4054 days ago
reply
Prairie Village, KS
popular
4055 days ago
reply
Share this story
Delete
1 public comment
DaftDoki
4053 days ago
reply
It seems right that my first share on newsblur is xkcd. Long live the nerds.
Seattle
MHogue
4053 days ago
I feel good about your decision.
katiegirl
4053 days ago
so many words! I can't read all that to figure out what it says.
MHogue
4053 days ago
@katiegirl, you're the worst best reader I've ever known.
DaftDoki
4053 days ago
Look at us talking about stories again!
MHogue
4053 days ago
Let's party like it's 2008!