I hereby claim:
- I am vikhyat on github.
- I am vikhyat (https://keybase.io/vikhyat) on keybase.
- I have a public key whose fingerprint is 4B56 5241 D57E 05C0 63FC D8BB 93DF 9F5A 4004 802A
To claim this, I am signing this object:
require 'auth/oauth2_authenticator' | |
class HummingbirdAuthenticator < ::Auth::OAuth2Authenticator | |
CLIENT_ID = 'removed' | |
CLIENT_SECRET = 'removed' | |
def register_middleware(omniauth) | |
omniauth.provider :hummingbird, CLIENT_ID, CLIENT_SECRET | |
end |
Hummingbird.LibraryEntryView = Ember.View.extend | |
user: Ember.computed.alias('controller.user') | |
didInsertElement: -> | |
@set 'reactComponent', LibraryEntryReactComponent( | |
content: @get('content') | |
view: this | |
) | |
React.renderComponent @get('reactComponent'), @get('element') |
package net.vikhyat.circle; | |
import junit.framework.TestCase; | |
import org.junit.Before; | |
import org.junit.Test; | |
public class CircleTest extends TestCase { | |
private Circle circle; | |
@Before |
require 'rubygems' | |
require 'bundler/setup' | |
require 'active_model_serializers' | |
require 'benchmark' | |
class BadgeType < Struct.new(:id, :name) | |
include ActiveModel::SerializerSupport | |
end | |
class Badge < Struct.new(:id, :name, :badge_type) |
:command WQ wq | |
:command Wq wq | |
:command W w | |
:command Q q |
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
require 'nokogiri' | |
require 'date' | |
require 'json' | |
def repair_broken_html(html) | |
rep = html | |
# Broken UTF-8 encoding. | |
rep = rep.unpack('C*').pack('U*') unless rep.valid_encoding? | |
# "<" is not escaped. | |
rep = rep.gsub(/<([^A-Za-z!\/])/, '<\1') |
I hereby claim:
To claim this, I am signing this object:
gets.to_i.times do | |
n = gets.to_i | |
puts 4*n*n - 3*n | |
end |
a, b = gets.split.map {|x| x.to_i } | |
data = [] | |
a.times do | |
data << gets.split.map {|x| x.to_i } | |
end | |
gets.to_i.times do | |
px, py, qx, qy = gets.split.map {|x| x.to_i } | |
sum = 0 |