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
| sudo yum install -y git gcc make readline-devel openssl-devel | |
| git clone https://github.com/rbenv/rbenv ~/.rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
| source ~/.bashrc | |
| # Install ruby-build system-widely | |
| git clone https://github.com/rbenv/ruby-build /tmp/ruby-build | |
| cd /tmp/ruby-build |
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
| # | |
| # Tested on 1.9.2-p290, Written by Miles Smith (WedTM) | |
| # | |
| require 'socket' | |
| class MCQuery | |
| MAGIC_PREFIX = "\xFE\xFD" | |
| PACKET_TYPE_CHALLENGE = "\x09" | |
| PACKET_TYPE_QUERY = "\x00" |
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 'socket' | |
| ## | |
| # Pings a minecraft server and returns motd and playercount. | |
| # Works with ruby >=1.9.3/2.0.0 | |
| # | |
| # More information and sample code here: | |
| # http://wiki.vg/Server_List_Ping | |
| ## | |
| class MinecraftPing |
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
| # This class is needed since Mongoid doesn't support Multi-parameter | |
| # attributes in version 4.0 before it's moved to active model in rails 4 | |
| # | |
| # https://github.com/mongoid/mongoid/issues/2954 | |
| # | |
| require "spec_helper" | |
| describe Mongoid::MultiParameterAttributes do |
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
| # The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| # | |
| # Current known FCC address ranges: | |
| # https://news.ycombinator.com/item?id=7716915 | |
| # | |
| # Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
| # | |
| # In your nginx.conf: | |
| location / { |
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
| <?php | |
| class Skin { | |
| public static function get($username) { | |
| $steve = in_array(strtolower($username), array("steve", "player", "default")); | |
| if(!$steve) $contents = self::fetch('http://skins.minecraft.net/MinecraftSkins/' . $username . '.png'); | |
| $defaultImage = WideImage::load("char.png"); | |
| $defaultType = "image/png"; | |
| if ($steve || $contents === false) { | |
| $img = $defaultImage; |