Skip to content

Instantly share code, notes, and snippets.

View ardian's full-sized avatar
💭
I may be slow to respond.

Ardian Haxha ardian

💭
I may be slow to respond.
View GitHub Profile
var http = require('http');
http.createServer(function (req, res){
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
})
.listen(8080, '127.0.0.1');
console.log('Server running at http://127.0.0.1:8080')
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'sass-rails', '5.0.2'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
@ardian
ardian / mail.rb
Created December 8, 2014 23:23
Ruby code to send email
require 'mail'
options = { :address => "smtp.gmail.com",
:port => 587,
:domain => 'gmail.com',
:user_name => '[email protected]',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true }
require 'mechanize'
mechanize = Mechanize.new
page = mechanize.get('https://www.google.com/')
form = page.forms.first
form['q'] = 'taekwondo'
require 'feedzirra'
class TestfeedsController < ApplicationController
def index
feed_urls = ["http://feeds.feedburner.com/PaulDixExplainsNothing"]
feeds = Feedzirra::Feed.fetch_and_parse(feed_urls)
@entry = feeds.entries
end
end