Ionic/Angular input type=range

April 11th 2014 by Jessica Legner

The project:

I am starting to fiddle with the Ionic Framework, which utilizes AngualrJS for building hybrid mobile apps. The project I have started needs a range slider for specifying how much of something is left.

The code:

<input type="range" name="amount" min="0" max="100" value="{{ some.amount.passed.in }}" ng-model="some.amount">

The issue:

The issue was that initially the range was at 50 no matter what the value was. I thought the value (some.amount.passed.in) was what determined where the range would start. This is not the case. The starting point is determined by the ng-model set in my controller.

The solution:

Pass the inital value of the range in the model. I removed the value attribute entirely without any issue.

<input type="range" name="amount" min="0" max="100" ng-model="some.amount">

nginx 413 Request Entity Too Large

March 18th 2014 by Jessica Legner

This error occured when I was tried to upload some photos to a friend's WordPress I have on my VPS. I just needed to increase the nginx size limit configuration for this site. To do this, add 'client_max_body_size xxM' where xx is the size in megabyes that you wish to allow. Example:

server {
    listen 80;
    server_name localhost;
    client_max_body_size 10M;
}

ssh key alias

January 3rd 2014 by Jessica Legner

Use this alias to copy your ssh key to the clipboard for easy retrieval (put it in ~/.bash_profile):

alias [name of alias]="cat [path to your id_rsa.pub] | pbcopy && echo 'Copied to clipboard.'"

Mine looks like this:

alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"

Any time you need your ssh key, just type sshkey, or whatever you decide to call it and paste the result wherever you need the key.

scp from Amazon EC2 to local

October 17th 2013 by Jessica Legner

Being new to working with AWS, something very trivial became a hurdle. So, I got this wrong a few times. First I got "Permission Denied", then "Broken Pipe", then finally "No such file or directory". I suspected that scp-ing would work, but I just had shit in the wrong order.

Try:

scp -i [key] -r [source] [destination]

YEP!

nginx symbolic link

September 20th 2013 by Jessica Legner

So, I decide to host a non-profit on my VPS. I have the site owner punch in my namespace settings on her end. I began to freak after a while when it doens't seem to be changing over to what I have on my server. WHAT'S wrong?! After ~20 minutes, check symbolic link.

YEP!

This is a Markdown blog.

August 11th 2013 by Jessica Legner

At a recent talk given by Dave Mosher on Angular JS and workflows with Lineman JS, he mentioned blogging with the help of Lineman and Markdown. This piqued my interest, so I gave it a whirl. It has been super easy to set up and get started.