Git Subtree

•October 25, 2013 • 1 Comment

I am a huge fan of git subtree.  This is a fairly new feature of git, so not all of the information on it is easy for me to remember how to use.  I’m going to post here how I use it.  The official README is here.

Also good information here.

Enable git subtree on Ubuntu

Git subtree is installed by default on Ubuntu 13.04 and 13.10, but it is not enabled.  To enable it:

sudo chmod +x /usr/share/doc/git/contrib/subtree/git-subtree.sh
sudo ln -s /usr/share/doc/git/contrib/subtree/git-subtree.sh /usr/lib/git-core/git-subtree

Add a subtree

This command must be run from the git root directory.

git subtree add -P <prefix> <refspec> --squash

<prefix> = From the current location, list the path and directory name that you would like to clone into.

<refspec> = Te .git location.  For a github repo, this will be git@github.com:account-name/repo-name.git

The squash option squashes logs.  Leave it off if you want full log listings in your subtree.

Add your subtree repo to git’s references

Doing this will make pulling and pushing easier, you can just use your ref-name instead of having to go get the refspec again.

git remote add -f ref-name git@github.com:account-name/repo-name.git

Update your subtree

git fetch ref-name branch-name
git subtree pull --prefix <prefix> ref-name branch-name --squash

Push changes

git subtree push --prefix <prefix> ref-name branch-name

Reset South Migrations on a Model

•August 23, 2013 • Leave a Comment

Sometimes when I’m initially developing, I end up with a TON of migrations before I’m ready to push to anything live.  If you’re at a point where you’re willing to dump and recreate, this can come in very handy.


cd $appname

# Remove the old migrations stuff
git rm -r migrations
git commit -m ‘Removed South migrations for the reset’

# Tell South to reset it’s database migrations for that app
./manage.py migrate –delete-ghost-migrations
./manage.py convert_to_south $appname
./manage.py schemamigration $appname –init
./manage.py migrate $appname

Enjoy your shiny new database!

LadyCoders Job Training Videos Now Available to All

•July 15, 2013 • Leave a Comment

We’re pleased to announce that we are making the LadyCoders job training videos available to everyone.  These videos were initially meant to help out women in technology, but most of the information in them will be helpful to just about anyone.

Included in the videos is information on how to whiteboard, preparing for your interview, legal information about contracts, a Q&A session with recruiters, the difference between 1099 and w4 employees, and when it’s appropriate to talk about issues such as disabilities and special needs.

Guest speakers in these sessions include Jon Callas, Mike Reinhardt, Lonnye Bower, and Shannon Anderson.

Here’s the torrent link at Kickass Torrents.

You can also download the torrent link directly from Dropbox.

Released under Creative Commons CC BY-NC.txt

If you want to support this effort and help the cause of mentorship in teech, you  can learn more at HackThePeople.org, ask questions at @tarah and @tanglisha, and support diversity in technology.

The Worth of Knowledge

•April 2, 2013 • Leave a Comment

A woman who I sometimes chat with in my gym came up to me this morning and asked me to spot her on bench press.  I was happy to do so, of course.  She’d seen me benching and wanted to try putting weight on the bar for the first time.

She wrapped her fingers and thumb around the same side of the bar in what is known as a thumbless or suicide grip.  I told her to put her fingers on one side and her thumb on the other, in a normal grasping motion.  She told me that her trainer had told her to grip the bar that way.  I explained to her that what she was doing was called a suicide grip for a reason, and suggested that she try it the other way.  She did, knocked out 8 reps of 55 lbs, thanked me, and I went back to my squats.

A few minutes later, I saw her with a trainer.  He was motioning to the muscles in his forearms while talking to her, and later spotted her while she benched with a suicide grip.

So, what is it that made that trainer’s opinion more valuable than mine?  I thought about it for a while and settled on some possible reasons.

  1. She’s paying him for his knowledge and instruction
  2. He works for the gym, so he must be very knowledgeable
  3. The man looks fairly muscular, so there’s a presumption that he knows what he’s doing

The first one is the one that gave me a little bit of a paradigm shift in my head.  If you pay someone to teach you something, do you automatically raise up that person’s level of knowledge in your head just because you are paying them?  Are they more worthy of your respect for that reason alone?  After all, if they weren’t very knowledgeable, you wouldn’t be paying them, right?

I’m not really sure if I’ve done this before or not.  Specifically with trainers, you don’t know what you’re getting until you’ve trained with them for a few sessions.  I can tell the difference now between a good, bad, or useless trainer just by watching them, but that wasn’t always true.  I’ve paid for lessons in a variety of things that were taught by people who only had a passing knowledge on the subject, I’ve gotten free lessons from people who were incredibly knowledgeable and passionate on the subject.  I learned to solder from a man that creates small electronic kits.  I learned to lift weights by a large group of people, some at my gym, some on reddit, and of course, my awesome coach Todd Christiansen.  I learned to program first in formal classes, then picked up more languages out of books and internet tutorials.  I learned to crochet from my great aunt.  I learned to boulder by a woman who travels the world bouldering.

I now have to decide what to do if this woman asks me to spot her again.  I’m not going to point out to her that she was already training with a group of very knowledgeable people before she hired her trainer.  I’m not going to tell her that no certifications are required to be a trainer at our gym, or that most of the trainers teach exactly the same workout to everyone that they train.  The truth here is that I am not at all confident that I can catch a bar dropped in a suicide grip, even if it only weighs 55lbs.  This is a safety issue for me.  

I firmly believe that this is a very advanced grip that should only be used when benching with three spotters or in the power cage.  It should certainly only be used by someone who is very comfortable with bench press and has a lot of experience with it.  This woman is a beginner who is still wobbly when benching the bar.  She needs a lot more practice before she’s ready for that grip – or before the slight musculature changes it gives you will actually make a difference for her.  The only answer I can think of is the truth – that I am uncomfortable spotting someone who is using a thumbless grip on bench press.

Who have you given authority to that didn’t deserve it?  Was it because you paid them money?  Were they built up by advertising?  Did a friend make a huge deal about how awesome they were?

PyCon 2013

•March 22, 2013 • Leave a Comment

I attended PyCon this year with LadyCoders.  I had such a wonderful time!  Because I was at our booth during most of the talks, I sadly missed a lot that I wanted to go to.  They are available online, but going and sitting there in person is an experience that I’m sad I had to miss.

I did manage to make it to two talks, the closing ceremony, and some of the lightning talks that came after the closing ceremony.  One of the talks was on MongoDB.  I find myself more and more interested in this NoSQL database.  While I don’t think it will do a better job than a SQL database would at what SQL handles best, I’m excited to find places in which it can do a better job at things that are painful in SQL.

As always, I love lightning talks.  I saw Python 3 run on an Atari emulator, and then two lightning talks later I heard a shout when the base code of Python 3 was patched to fix a bug discovered in that presentation.  Oh, how I adore this community!

I heard a talk from a teacher working to get rid of grading in high school, and instead work with schools to make high school goal driven.  I think this is a great idea to work on as a possible way to improve the current state of schools.  Stop the mockery of being held back a grade, and just have everyone move forward as they’re able.

I also heard from what appeared to be the reincarnation of Billy Mays about Python Anywhere – a Python cli that you can run in your browser.  The joy and energy that went into this talk was absolutely amazing, I think the talk made every single person in the room happy.

So, there you have it.  I got to experience very few talks, but the ones I did were awesome.  I encourage everyone to try to attend next year, even if that means having to learn French :)

Defcon Fun

•August 9, 2012 • Leave a Comment

I had such an amazing time at Defcon!

My friend Tarah of thecowgirlcoder.com and I went together.  We ended up teaming up with the Psychoholics for the Mystery Challenge, and we won!  I got to learn to write code for an Arduino and programmed our Tom Servo.  I also performed a crimp with some of my team members.

Despite all this excitement, I did manage to sit in on some fabulous talks.  I have a lot more interest in security than I used to, though I still feel that the amount of information that needs to be addressed is pretty daunting.

I’d like to thank the Psychoholics for being so welcoming, and LostboY for putting together such a ridiculously fun game to play.  The experience would not have been the same without your efforts, and they are very much appreciated :)

WordPress Depreciation Errors

•July 1, 2012 • Leave a Comment

I keep getting notices of errors and warnings for depreciated calls in plugins.  I’m creating a resource here for the fixes for these niggling little things that are driving me so crazy.

has_cap was called with an argument that is deprecated

The correction for this error is to adjust the call to an appropriate user role.  I’ll update the following table as I run into things.

 

Old Level/Capability New Role
0 Subscriber
1 Contributor
2 Author
3 Editor
4 Editor
5 Editor
6 Editor
7 Editor
8 Administrator
9 Administrator
10 Administrator
publish_posts Editor
 
Follow

Get every new post delivered to your Inbox.