Skip to content

Instantly share code, notes, and snippets.

View stevepm's full-sized avatar
🏠
Working from home

Steve stevepm

🏠
Working from home
View GitHub Profile
@ChuckJHardy
ChuckJHardy / digital_ocean_setup.md
Last active October 27, 2023 17:51
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@dwayne
dwayne / advice.md
Last active August 29, 2015 14:06
Suggestions from Jeff Browning at Pinecone on improving my skills at AngularJS and Rails.

AngularJS

  • Build custom directives. Basic controllers and templates are great, but anything beyond basic interactivity usually requires custom directives. The learning curve for custom directives can be challenging, so just take it one step at a time.
  • Inter-directive communication via controllers.
  • Become very familiar with scope usage, best practices, and pitfalls. Scope inheritance, and encapsulation are some of the areas where Angular can drive you insane, but this knowledge is essential in order to build large-scale, maintainable Angular apps.
  • Explore the differences between Services, Factories, and Providers.
  • Become a testing expert. One thing that I like about the Angular community is that tests are expected and encouraged.

Here are some resources to help:

@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 01:38
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@lsegal
lsegal / config.ru
Last active August 29, 2015 13:58 — forked from anonymous/config.ru
require_relative 'boot'
db = Sequel.connect(ENV['DATABASE_URL'])
Urls.attach_db(db[:urls])
run UrlShortener
anonymous
anonymous / config.ru
Created April 9, 2014 02:55
require_relative 'boot'
db = Sequel.connect(ENV['DATABASE_URL'])
Urls.attach_db(db[:urls])
run UrlShortener
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

<?php
include("simple_html_dom.php");
// Create DOM from URL or file
$html = file_get_html('http://www.google.com/');
// Find all images
/*foreach($html->find('img') as $element)
echo $element->src . '<br>';
// Find all links
@kinopyo
kinopyo / omniauth_macros.rb
Created November 4, 2011 05:44
Integration test with Omniauth. This example is using twitter, and assume you've installed rspec and capybara. Official document is here: https://github.com/intridea/omniauth/wiki/Integration-Testing
# in spec/support/omniauth_macros.rb
module OmniauthMacros
def mock_auth_hash
# The mock_auth configuration allows you to set per-provider (or default)
# authentication hashes to return during integration testing.
OmniAuth.config.mock_auth[:twitter] = {
'provider' => 'twitter',
'uid' => '123545',
'user_info' => {
'name' => 'mockuser',