Skip to content

Instantly share code, notes, and snippets.

@coderanger
coderanger / pitch.md
Last active January 6, 2018 04:11
Old clan warfare idea I found

Clan Warfare Revamp Make-A-KoL

Elevator Pitch

Make clan war be a turned-based tower defense minigame. Towers and tower upgrades have an escalating cost so larger clans don't have an advantage. Each player gets one clan attack a day if they are participating and can attack either a random clan for material rewards or a specific clan for bragging rights points (similar to PvP).

@coderanger
coderanger / chef-server.rb
Created April 4, 2017 21:00
ssd's config example for Chef Server external stuffs
fqdn "FQDN"
postgresql['external'] = true
postgresql['vip'] = 'EXTERNAL_PG_IP'
postgresql['db_superuser'] = 'DB_SUPERUSER'
postgresql['db_superuser_password'] = 'DB_SUPERUSER_PASSWORD'
opscode_solr4['external'] = true
opscode_solr4['external_url'] = 'http://EXTERNAL_ES_IP:9200'
opscode_erchef['search_provider'] = 'elasticsearch'
opscode_erchef['search_queue_mode'] = 'batch'
bookshelf['storage_type'] = :sql
@coderanger
coderanger / example.rb
Created June 15, 2016 22:31
Example of subclassing the Unicorn resource
module MyUnicorn
# Subclass the resource.
class Resource < PoiseApplicationRuby::Resources::Unicorn::Resource
# Give it a new name so we can find it.
provides(:my_unicorn)
# Add a new property. Could do more here.
property(:listen)
end
# Subclass the provider.
@coderanger
coderanger / make_diecut.py
Created September 6, 2016 03:05
Automatically extract diecut paths for an image.
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import re
import sys
import attr
import cv2
import numpy
@coderanger
coderanger / file.rb
Created May 18, 2016 00:20
File transport API sketch.
# Remote file or directory proxy object.
#
# @since 1.0.0
class File
# Create a proxy object. All data is lazy-loaded so this does very little.
#
# @param connection [Airlift::Connection] Connection object to use for
# operations.
# @param path [String] File or directory path.
# @param follow_symlink [Boolean] Follow symlinks when getting file info.
@coderanger
coderanger / berks-api-lite.rb
Created October 30, 2014 23:42
Berks API Lite.
#!/usr/bin/env ruby
require 'json'
require 'openssl'
require 'tempfile'
require 'fog'
BUCKET = 'something'
ROOT = File.expand_path('..', __FILE__)
UNIVERSE = {}

Keybase proof

I hereby claim:

  • I am coderanger on github.
  • I am coderanger (https://keybase.io/coderanger) on keybase.
  • I have a public key whose fingerprint is AF25 8FBF 2D56 96D9 5764 0543 445B 6255 C512 B26E

To claim this, I am signing this object:

@coderanger
coderanger / readme.md
Created February 25, 2016 03:23
ChefConf 2016 Proposal Ideas

Anyone Can Cook: Writing Good Cookbooks as a Beginner

Abstract

Learning to write high-quality Chef cookbooks can be a daunting prospect. There are few resources and little documentation. Let's dive in to the best practices to build usable, maintainable, and delightful Chef cookbooks. We'll cover the structure of great cookbooks for new and experienced Chefs alike.

Outline

@coderanger
coderanger / travis.rb
Last active January 20, 2016 20:59
WIP knife travis plugin.
require 'chef/knife'
module Poise
class Travis < Chef::Knife
include Chef::Mixin::ShellOut
deps do
require 'yaml'
require 'kitchen'
end
@coderanger
coderanger / fuckitencoder.py
Created January 17, 2014 21:21
For when you absolutely, positively must get something that looks like JSON.
MEMORY = '<memory>'
class FuckItEncoder(json.JSONEncoder):
def default(self, obj):
try:
return json.JSONEncoder.default(self, obj)
except RuntimeError:
return '<recur>'
except MemoryError:
return MEMORY
except TypeError: