Skip to content

Instantly share code, notes, and snippets.

View kotp's full-sized avatar
enjoying life

Victor Goff kotp

enjoying life
View GitHub Profile
### Keybase proof
I hereby claim:
* I am kotp on github.
* I am kotp (https://keybase.io/kotp) on keybase.
* I have a public key ASAZ-2QjHxmrp0drjwUoaSzV7bXnawAQN94aXJuRAbsQpgo
To claim this, I am signing this object:
@kotp
kotp / .vimrc
Created January 2, 2017 14:39 — forked from fweep/.vimrc
Vim configuration for interacting with cscope databases (focus on Ruby).
if has("cscope")
"TODO: turn this all into a plugin.
set nocscopetag
set cscopequickfix=s-,c-,d-,i-,t-,e-
set nocscopeverbose
if filereadable(".git/cscope.out")
cscope add .git/cscope.out
endif
set cscopeverbose
@kotp
kotp / time_with_microseconds.rb
Last active August 29, 2015 14:17
Result of refactoring other code, uses time library and features a proc.
require 'time'
get_time = ->(t) { [t.iso8601, t.usec] }
report = 'something to report with a detailed time: %s'
puts report % get_time[Time.now]
@kotp
kotp / pop_quiz.md
Last active August 29, 2015 14:13
Question For You To Answer in a Forum

Pop Quiz:

  1. Do you like the scent of skunks?
  2. Do you like fleas?
  3. Do you really like the things you hate?
  4. Do you really like the things you really hate?

Keybase proof

I hereby claim:

  • I am kotp on github.
  • I am kotp (https://keybase.io/kotp) on keybase.
  • I have a public key whose fingerprint is 29EC 2514 F41A D0F6 662E C570 2313 1F61 C879 8FA8

To claim this, I am signing this object:

class Float
def near_enough?(other, epsilon = Float::EPSILON)
(self - other.to_f).abs < epsilon.to_f
end
end
@kotp
kotp / global_var.rb
Last active December 12, 2015 12:29
Exploring modules, constants and methods
puts "Loading global_var.rb"
GlobalConstant = 'GlobalConstant'
$GlobalConstant_WithDollarSign = 'Global Constant with Dollar Sign'
module SharedVar
NAMESPACED_CONSTANT = 'Named spaced constant'
def your_method
"Whatever your method would be."
end
@kotp
kotp / README.md
Last active July 12, 2018 02:49
RubyLearning Exercises and Answers

A collection of exercises and answers.

@kotp
kotp / 4_2_12 apt-cache policy
Created April 2, 2012 04:24
aptitude install attempt
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://download.webmin.com/download/repository/ sarge/contrib Packages
release v=3.1,o=Jamie Cameron,a=stable,n=sarge,l=Webmin,c=contrib
origin download.webmin.com
500 http://security.ubuntu.com/ubuntu/ lucid-security/universe Packages
release v=10.04,o=Ubuntu,a=lucid-security,n=lucid,l=Ubuntu,c=universe
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ lucid-security/restricted Packages
@kotp
kotp / minitest_assertions.rb
Last active October 2, 2015 03:38
MiniTest Assertions and Specs
#!/usr/bin/env ruby
# require 'test/unit'
require 'minitest/spec'
Columns= 3
def column_check
if @column_count == Columns
puts
@column_count = 0
end