This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HotCocoa::Mappings.map :gl_view => :NSOpenGLView do | |
| defaults :frame => DefaultEmptyRect, | |
| :layout => {} | |
| constant :auto_resize, { | |
| :none => NSViewNotSizable, | |
| :width => NSViewWidthSizable, | |
| :height => NSViewHeightSizable, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def has_gem?(name, version=nil) | |
| if !$GEM_LIST | |
| gems = {} | |
| `gem list --local`.each_line do |line| | |
| gems[$1.to_sym] = $2.split(/, /) if line =~ /^(.*) \(([^\)]*)\)$/ | |
| end | |
| $GEM_LIST = gems | |
| end | |
| if $GEM_LIST[name.to_sym] | |
| return version ? $GEM_LIST[name.to_sym].include?(version) : true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'json' | |
| require 'sinatra' | |
| File.open('whois_proxy.pid', 'w') { |f| f.write(Process.pid) } | |
| get '/whois/:tld/:domain' do | |
| domain = (params['domain'] || '').gsub(/[^a-zA-Z0-9\-\_]/, '') | |
| tld = (params['tld'] || '').gsub(/[^a-zA-Z0-9\-\_]/, '') | |
| available = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/ruby | |
| filename = $*[0] | |
| lines = {} | |
| puts "Comparing #{filename}" | |
| File.open(filename, "r") do |f| | |
| while (line=f.gets) do | |
| line = line.downcase.gsub(/\n/, '') | |
| lines[line] ||= 0 | |
| lines[line] += 1 |
NewerOlder