Skip to content

Instantly share code, notes, and snippets.

View ParkinT's full-sized avatar

Thom Parkin ParkinT

View GitHub Profile
@ParkinT
ParkinT / DockerCLIalias
Last active August 29, 2015 14:07 — forked from caike/Dockerfile
# ~/.bash_aliases
# Kill all running containers.
alias dockerkill='docker kill $(docker ps -a -q)'
# Delete all stopped containers.
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
# Delete all untagged images.
alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)'
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
module Bacon
class Context
def expect(obj)
Bacon::Should.new(obj)
end
end
end
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'json'
require 'open-uri'
require 'uri'
require 'net/http'
CODE_LIMIT = 10
$url = "https://eval.in/"
$languages = {
require 'webrick'
Port = 3000
Directory = Dir::pwd
WEBrick::HTTPServer.new(
Port: Port,
DocumentRoot: Directory
).start
#!/usr/bin/env ruby
# gem install sinatra --no-document
# gem install github-markdown --no-document
# usage: ruby markedown.rb then, in Nitrous, simply select 'Preview -> Port 3000' on the menu
require 'sinatra'
require 'github/markdown'
# Set port for compatability with Nitrous.IO
configure :development do
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
print 'Github Username: '
username = gets.chomp
# get gists
puts 'Downloading gists list'
gists_str = open("https://api.github.com/users/#{username}/gists").read