Skip to content

Instantly share code, notes, and snippets.

@arpit
arpit / cryptokitties.sol
Created January 23, 2018 21:33
Cryptokitties Contract from the Eth blockchain
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
@mahemoff
mahemoff / application_controller.rb
Created April 9, 2015 23:02
Cloudflare country detection (geo-ip) in Ruby/Rails
class ApplicationController < ActionController::Base
def cloudflare_country_code
request.headers['HTTP_CF_IPCOUNTRY']
end
def eu_request?
cloudflare_country_code.in? %w(GB FR DE ..... )
end