Skip to content

Instantly share code, notes, and snippets.

View zotherstupidguy's full-sized avatar

Mo zotherstupidguy

  • hackspree
  • simplicity is the final achievement
View GitHub Profile
<p>hackspree gist demo</p>
@zotherstupidguy
zotherstupidguy / octokit_gists.rb
Created April 18, 2017 21:56 — forked from komasaru/octokit_gists.rb
Ruby script to get gist lists by octokit.
require 'octokit'
# API 呼び出し回数
ratelimit = Octokit.ratelimit
ratelimit_remaining = Octokit.ratelimit_remaining
puts "Rate Limit Remaining: #{ratelimit_remaining} / #{ratelimit}"
puts
# インスタンス化
# ==== 認証無しの場合
@zotherstupidguy
zotherstupidguy / Redis-Ruby_Inverted-Index-Search-(Antirez)
Created February 22, 2017 09:16 — forked from budhash/ Redis-Ruby_Inverted-Index-Search-(Antirez)
Build an inverted index for a full-text search engine with Redis.
--
@zotherstupidguy
zotherstupidguy / clone-all-twitter-github-repos.sh
Created December 21, 2016 20:27 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@zotherstupidguy
zotherstupidguy / hilong.rb
Created December 21, 2016 14:43 — forked from jstorimer/hilong.rb
hilong -- A simply utility to show character counts for each line of input and highlight lines longer than 80 characters.
#!/usr/bin/env ruby
# A simply utility to show character counts for each line of input and
# highlight lines longer than 80 characters.
#
# Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html
#
# Examples:
#
# $ hilong Gemfile
@zotherstupidguy
zotherstupidguy / MiniTest::Spec Cheat Sheet
Created December 20, 2016 15:58
MiniTest::Spec matchers cheat sheet. (from: mattsears.com/articles/2011/12/10/minitest-quick-reference)
#Assertion Examples
must_be list.size.must_be :==, 0
must_be_close_to subject.size.must_be_close_to 1,1
must_be_empty list.must_be_empty
must_be_instance_of list.must_be_instance_of Array
must_be_kind_of list.must_be_kind_of Enumerable
must_be_nil list.first.must_be_nil
must_be_same_as subject.must_be_same_as subject
must_be_silent proc { "no stdout or stderr" }.must_be_silent
@zotherstupidguy
zotherstupidguy / ml-ruby.md
Created December 2, 2016 07:31 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

Resources for Machine Learning in Ruby

Gems

@zotherstupidguy
zotherstupidguy / gist:89ea48378ec8831d3f7d498b6a621d3b
Created November 27, 2016 21:53 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
@zotherstupidguy
zotherstupidguy / ssl_puma.sh
Created October 26, 2016 06:02 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key