Skip to content

Instantly share code, notes, and snippets.

View andycandrea's full-sized avatar

Andy Andrea andycandrea

View GitHub Profile
@andycandrea
andycandrea / finder.rb
Created September 29, 2016 15:12
Compares the git log of two branches to find tasks represented in one but not the other
# Very rough draft
# TODO: Clean up, extract into multiple objects and then convert to a
# gem/executable.
class TaskFinder
def initialize(outdated_branch, updated_branch)
@outdated_branch = outdated_branch
@updated_branch = updated_branch
end
def updated_tasks_and_branches
@andycandrea
andycandrea / .rubocop.yml
Last active August 29, 2015 14:07
Default .rubocop.yml file
# This file should be placed in the root directory of an application using
# the Rubocop gem. For a sense of the most common Rubocop complaints in your
# project, run `rubocop --format offenses` to see a list of the most common
# issues. In addition, you can run rubocop -a to allow Rubocop to autocorrect
# some of the issues it detects. On one project, this made several thousand
# changes and led to only two issues, one from the Lint/DeprecatedClassMethods
# cop and one from Style/Blocks.
# For use with rubocop-rspec gem
require: rubocop-rspec
@andycandrea
andycandrea / ruby_materials.md
Last active August 29, 2015 14:05 — forked from zporter/reading_materials.md
Advanced Ruby Materials
@andycandrea
andycandrea / resources.md
Last active July 10, 2018 19:14 — forked from zporter/resources.md
A list of resources for learning Rails and relevant technologies

A list of resources that aspiring Rails developers can use to learn Rails and other relevant technologies. This list includes some resources that I see recommended all over the web--not all of which I like--as well as some hidden gems that I've found valuable. This list is intended to supplement my blog post here.

Ruby

  • Codecademy
    • One of the more well-known sites to offer interactive programming tutorials, Codecademy is probably best utilized by those who are pretty new to programming, though the Ruby tutorial is good for teaching Ruby syntax and eventually gets into some less trivial material.
  • Try Ruby
  • Pretty similar to Codecademy. Once again, it's beginner-friendly, though, as someone who knew about object-oriented programming beforehand, I found it somewhat annoying to use, as there's no page with links to the individual exercises (at le
@andycandrea
andycandrea / hackernews.py
Created February 28, 2014 21:23
Get the most recent stories on HackerNews
import sys
from hn import HN
hn = HN()
print "Enter number of stories you'd like to view: "
n = raw_input()
while not n.isdigit():
print "Enter an integer: "
n = raw_input()
n = int(n)
@andycandrea
andycandrea / guess.py
Last active August 29, 2015 13:56
Python Guessing Game for TotT
import random
target = random.randint(1,100)
#print target
for i in range(5):
print "Guess a number between 1 and 100 (inclusive): "
guess = raw_input()
guess = int(guess)
print guess
@andycandrea
andycandrea / simpleshell.c
Last active August 29, 2015 13:56
A simple Linux shell and one of my first projects written in C. It gave me my first real experience with pointers, structs and memory management, as well as fork() and exec().
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
#include <sys/stat.h>
/*
* This program works as a simple Linux shell. Linux commands with up to four arguments are supported,
@andycandrea
andycandrea / snakeclone.py
Created February 8, 2014 23:46
A simple clone of the popular game "Snake" I made shortly after getting my Raspberry Pi and diving into Linux for the first time several years ago.
#!/usr/bin/env python
"""
A simple clone of the game Snake made to expose myself to Python/Pygame. Inspired by the guide in
the Raspberry Pi User Guide by Eben Upton and Gareth Halfacree, though I did make some changes
based on my preferences and coding style.
"""
import pygame, sys, time, random
from pygame.locals import *
@andycandrea
andycandrea / server.js
Created February 7, 2014 21:18
Server for TotT
var http = require('http');
var server = http.createServer(function(req,res) {
res.writeHead(200, {'Content-Type':'text/plain'});
res.end('Hello World\n');
});
server.listen(1337);
console.log('Server running at http://192.168.33.10:1337/');
@andycandrea
andycandrea / guess.js
Created February 7, 2014 20:45
Basic JS Guessing Game created for use with TotT (Tools of the Trade - a series of lectures at UNC intended to supplement the CS curriculum)
/*
JS guessing game that picks a random number between 1 and 100 and prompts the user for up to five guesses.
The program then prints if the correct number is less than, greater than or equal to the guess. If five
guesses are completed without getting the right number, a loss message is output.
*/
var correct = Math.floor(Math.random()*100)+1;
console.log(correct);
var readLine = require('readline'), rl = readLine.createInterface(process.stdin, process.stdout);