archive-am.com » AM » S » SEANGRAH.AM

Total: 8

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

  • HELLO THERE I M SEAN Just another rails fanboy from the East Coast who loves pineapple pizza and the feeling of clean socks ABOUT CODE BLOG

    Original URL path: http://www.seangrah.am/ (2016-03-24)
    Open archived version from archive


  • seangrah.am
    the excellent Emmet plugin for Sublime Text because frankly they re all amazing tools that make life easier On the the backend I have the most experience with Ruby on Rails PostgreSQL and MySQL I use Jekyll for my static sites like this one and Cucumber for testing I m also not ashamed to say Wordpress is where I started my web development addiction in 2011 We have been through

    Original URL path: http://www.seangrah.am/about/ (2016-03-24)
    Open archived version from archive

  • seangrah.am
    seangrah am About Code Blog Contact If Then Raddit Reddit Clone GeoGuesser Google API Game Cookie Munchers Rails Ecommerce Github Twitter LinkedIn Whenever

    Original URL path: http://www.seangrah.am/code/ (2016-03-24)
    Open archived version from archive

  • seangrah.am
    seangrah am About Code Blog Contact Digital Thought Programming an Insulting Twitterbot in R Github Twitter LinkedIn Whenever

    Original URL path: http://www.seangrah.am/blog/ (2016-03-24)
    Open archived version from archive

  • Raddit - Reddit Clone • seangrah.am
    as a project for another time So now that we have the main functions of the site we set about coding it all from the ground up right WRONG SO WRONG Don t you know programmers are naturally lazy mountain dew chugging scum So here we see the true power of RoR lies in Gems Gems are programs or libraries AKA tools to help you do more faster You still have to take time to understand each part of your tool or it will only cause you harm Much in the same way that a power tool can mess you up I miss shop class And my left pinky finger Anyways So with the functions outlined we can search for Gems that help us For User Authentication Signing Up Logging In Loggin Out there is a beautiful amazing fantastic Gem called Devise For Upvoting and Downvoting we have a Gem called Acts As Votable Which as its name implies adds the ability to keep track of votes on a particular Data Model In this case it will be our Posts Creating Editing and Deleting Links are simple CRUD tasks that don t require a Gem gem devise 3 4 1

    Original URL path: http://www.seangrah.am/code/raddit-reddit-clone/ (2016-03-24)
    Open archived version from archive

  • GeoGuesser - Google API Game • seangrah.am
    the problems I would have to solve First I had to get a list of cities then import those cities somehow into the application s database then write a function to randomly grab the two pairs then finally a way to determine if the player chose correctly or not I also needed to work with the database format PostGres so that I could deploy it to Heroku To solve the first of these problems I realized I would need to make a csv of the cities I started with 100 gathered from different free databases Then I used athe gem smarter csv to help me read it into my app Geocoder was the gem that allowed Rails to consume the Google API gem geocoder gem smarter csv 1 1 This code was made from a custom rake task I used to import the csv into the database Since GeoCoder was set to add longitude and latitude data when any locations entry was updated it automatically set to work filling in the data I ran into some problems with the amount of API calls during the rake task but I worked around that with a small timer in between database changes class CreateLocations ActiveRecord Migration def change create table locations do t t string address t float latitude t float longitude t timestamps null false end end end Here is the function I used to grab 4 random locations from the database def random locations Location limit 5 order RANDOM end This is a sample view to show the use of GeoCoder This view displays the first city the distance between the cities and then the second city This showed that I could call al the data points that would be required to create the actual game by hiding the distance

    Original URL path: http://www.seangrah.am/code/geoguesser-google-api-game/ (2016-03-24)
    Open archived version from archive

  • Cookie Munchers - Rails Ecommerce • seangrah.am
    a couple options for ecommerce Gems but I found Shoppe had a more active community so if I ran into trouble at some point I would be able to get questions answered Luckily I ran into very minor snags implementing it but it ws nothing I couldn t solve with some furious Googling Implementing a minimum order notice using Shoppe was as easy as span style color red if current order total before tax 6 You have not met the minimum order end span This order form was an example of custom building the app for the Rowan campus They can select from a dropdown menu of all the Rowan dorms and then give their room number dt f label email address Email address dt dd f text field email address dd dt f label phone number Phone number dt dd f text field phone number dd f label billing address1 Deliver to p f label billing address2 Building f select billing address2 Townhouses Edgewood Robo Laurel Oak Evergreen Mullica Willow Magnolia Chestnut Triad Whitney International f label billing address1 Room Number f text field billing address1 p Implementing the payment system required installing a seperate Gem so my order

    Original URL path: http://www.seangrah.am/code/cookie-munchers-rails-ecommerce/ (2016-03-24)
    Open archived version from archive

  • Programming an Insulting Twitterbot in R • seangrah.am
    the final product Shakespeare Insult Bot Let s get started First we are going to grab all the libraries we need install packages twitteR install packages stringr library twitteR library stringr Install packages does just what it says Its like supercharging your basic R program with ninja skills in the form of these packages Library then puts those new packages into use in the programming environment TwitteR is our library that makes it easy to pass information back and forth between our program and the site Stringr is a library for manipulating text also called strings and will help us build our insult generator That s already 20 of the code done Next we are going to load our insults into 3 seperate variables with an addition variable for our sassy hashtags insults1 read table InsultsCol1 txt sep t insults2 read table InsultsCol2 txt sep t insults3 read table InsultsCol3 txt sep t hashtag read table InsultsHashtag txt sep t Those 4 text files were made from the website discussed earlier They consist of lists for a 3 part insult generator and then I added a fourth list for that sweet Twitter hashtag style Ok I ll stop doing hashtags now I promise Next we are going to write up the actual insult generator and load it into a variable tweettxt str c Thou sample insults1 1 1 sample insults2 1 1 sample insults3 1 1 sample hashtag 1 1 Let s test that tweettxt 1 Thou dankish clapper clawed haggard thereisaidit What we are doing is taking a sample of each of the lists of insult parts and combining them into one string and putting that string into tweettxt for safe keeping The sample grabs a random entry in the dataframe It picks a random row but always from

    Original URL path: http://www.seangrah.am/blog/programming-an-insulting-twitterbot-in-r/ (2016-03-24)
    Open archived version from archive



  •