Skip to content

Instantly share code, notes, and snippets.

View superscott's full-sized avatar
щ(ಠ益ಠщ) (✖╭╮✖) ᕦ(ò_óˇ)ᕤ

superscott superscott

щ(ಠ益ಠщ) (✖╭╮✖) ᕦ(ò_óˇ)ᕤ
View GitHub Profile
<div id="error_page" class="box">
<h1>Ops, 404</h1>
<!--因为不排除连rails 都无法运行的情况 所以添加 'public/STATUS.htm' 还是很有必要的-->
Finally, the default exceptions application used by Rails that simply renders a page in `public/STATUS.html` is available here: [action_dispatch/middleware/public_exceptions.rb](
Remember that whatever you do in the errors controller, it should not be anything “fancy”. Keep it simple because something already went wrong with your application!
(function(b, k, l, h) {
var i = function(a, b) {
arguments.length && this._init(a, b)
}, j = 0;
i.prototype = {
defaults: {
mainClass: "pickList",
listContainerClass: "pickList_listContainer",
sourceListContainerClass: "pickList_sourceListContainer",
controlsContainerClass: "pickList_controlsContainer",
superscott / pyrag.rb
Created March 7, 2014 22:41
shitty math
n1 = ARGV[0]
n2 = ARGV[1]
e1 = ARGV[2]
e2 = ARGV[3]
n = n1.to_f - n2.to_f
e = e1.to_f - e2.to_f
nn = n * n
ee = e * e
superscott / Main.rb
Last active August 29, 2015 13:57
rails email validator?
class Main
validate :email_is_valid
def email_is_valid
vtools =
unless vtools.email_valid?(
logger.error("Invalid Email Domain :: PID: #{$$} EmailDomain: '#{vtools.domain}' ::")
errors.add(:base, "Invalid Email Address.")
source ''
gem 'rails', '4.0.4'
gem 'mysql2'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'awesome_print', :github => 'michaeldv/awesome_print'
gem 'pry'
desc 'Validating JavaScript with Ant /lib/tasks/js_validate/'
task 'validate:javascript' do
puts 'Validating JavaScript with Ant /lib/tasks/js_validate/'
puts `cd #{Rails.root}/lib/tasks/js_validate/ && ant validate-javascript`
superscott /
Created May 22, 2014 13:38

Keybase proof

I hereby claim:

  • I am superscott on github.
  • I am superscott ( on keybase.
  • I have a public key whose fingerprint is 3187 DA2F 5515 23DE 9591 7841 3293 6ED8 5088 25EF

To claim this, I am signing this object:

@cache ||= begin
return true if condition1 && condition2
return true if condition3
return true if condition4
superscott /
Last active August 29, 2015 14:05
WPScan Error Output
~/projects/wpscan [13:22:19] [ruby-2.1.2@rails4] $ curl -IkL
HTTP/1.1 301 Moved Permanently
Content-Length: 157
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/8.0
X-Powered-By: PHP/5.4.23
X-Powered-By: ASP.NET
Set-Cookie: ARRAffinity=1585cb42abd371ffda100f8cd315354b3b6a2e7476bd3a0acfa838f0a0af0abb;Path=/;
superscott /
Last active August 29, 2015 14:05
check if azure vm is running.....
# Pass the vm name as the first argument
# Check to make sure the VM is Present (in a silly way).
# data = good, warn = bad.
vm_exist=`azure vm show $vm_name | awk '{print $1}'| uniq | sed 's/://g' | grep warn`
# Default Time Output for Pretty Print.