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
# インスタンス化
# ==== 認証無しの場合
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference
@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 / spec.rb
Created January 10, 2017 12:52
ruby specs example
describe "this code" do
it "takes x, y, & z then produces their product" do
# assertive testing code here
end
it "takes logs its activites" do
# assertive testing code here
end
end
@zotherstupidguy
zotherstupidguy / Xmodmap
Last active December 24, 2016 19:14
Using this to easily navigate the terminal and focus on work, works well with emacs as well
▲ ~/Work cat ~/.Xmodmap
! output taken from:
! xmodmap -pke | egrep '(Control|Super|Alt|Menu)'
! Use to set keycodes correctly below. List reordered to match
! keys from left to right.
! keycode 66 = CapsLock
! keycode 37 = Control_L NoSymbol Control_L
! keycode 133 = Super_L NoSymbol Super_L
! keycode 64 = Alt_L Meta_L Alt_L Meta_L
@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