Skip to content

Instantly share code, notes, and snippets.

class ErrorsController < ApplicationController
def not_found
render :status => 404, :formats => [:html]
end
def server_error
render :status => 500, :formats => [:html]
end
end
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
@anbublacky
anbublacky / youtube channel upload image
Created June 30, 2015 12:03
youtube channel upload image
#!/usr/bin/ruby
require 'rubygems'
gem 'google-api-client', '>0.7'
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/file_storage'
require 'google/api_client/auth/installed_app'
# This OAuth 2.0 access scope allows for read-only access to the authenticated
@anbublacky
anbublacky / set youtube channer banner
Created July 1, 2015 03:55
google api v3, set youtube channer banner, using ruby
#!/usr/bin/ruby
require 'rubygems'
gem 'google-api-client', '>0.7'
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/file_storage'
require 'google/api_client/auth/installed_app'
# This OAuth 2.0 access scope allows for read-only access to the authenticated
@anbublacky
anbublacky / gist:f4605d14891bf036c65e
Created July 21, 2015 11:56
youtube_banner_open browser error
LAUNCHY_DEBUG: URI parsing pass 1 : https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=259660604872-kh04mirn4j38hbo3fpfrhi9cuvcc6b03.apps.googleusercontent.com&redirect_uri=http://localhost:9292/&response_type=code&scope=https://www.googleapis.com/auth/youtube -> {:scheme=>"https", :user=>nil, :password=>nil, :host=>"accounts.google.com", :port=>nil, :path=>"/o/oauth2/auth", :query=>"access_type=offline&client_id=259660604872-kh04mirn4j38hbo3fpfrhi9cuvcc6b03.apps.googleusercontent.com&redirect_uri=http://localhost:9292/&response_type=code&scope=https://www.googleapis.com/auth/youtube", :fragment=>nil}
LAUNCHY_DEBUG: Checking if class Launchy::Application::Browser is the one for handles?(https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=259660604872-kh04mirn4j38hbo3fpfrhi9cuvcc6b03.apps.googleusercontent.com&redirect_uri=http://localhost:9292/&response_type=code&scope=https://www.googleapis.com/auth/youtube)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFam
@anbublacky
anbublacky / python
Created May 19, 2011 13:41
python-webscraping
import urllib2
import re
import subprocess
from BeautifulSoup import BeautifulSoup, SoupStrainer
@anbublacky
anbublacky / gist:2971067
Created June 22, 2012 07:40
Facing Error while creating exe- Undefined method full_name
be removed on or after 2011-10-01.
Gem::Specification#installation_path called from C:/RailsInstaller/Ruby1.9.3/lib
/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:557.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will
be removed on or after 2011-10-01.
Gem::Specification#installation_path called from C:/RailsInstaller/Ruby1.9.3/lib
/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:557.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will
be removed on or after 2011-10-01.
Gem::Specification#installation_path called from C:/RailsInstaller/Ruby1.9.3/lib