Skip to content

Instantly share code, notes, and snippets.

View kalv's full-sized avatar

Kalv Sandhu kalv

View GitHub Profile
Show me a snippet of code that types out characters inside of a p tag
Can you change it so that it performs that on a couple of p tags
That's great. Can you have it so that the text is in the p tag and not in the textsToType?
Sweet, can you show me some css that will place those p tags in the center of the page and also have the colors styled like an old VDU terminal
Can you show some small text in the bottom right corner of the screen stating the page was proudly built with AI on earth.
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
@kalv
kalv / gist:7147336
Last active December 26, 2015 11:59
A list of links, patches and articles to help with Mavericks os x for ruby development
@kalv
kalv / gist:4717116
Created February 5, 2013 19:55
Big decimal is ok
>> require 'bigdecimal'
=> true
>> BigDecimal.new(0.75,2)
=> #<BigDecimal:7fc6fc0f2330,'0.75E0',9(36)>
>> _.to_f
=> 0.75
>> RUBY_VERSION
=> "1.9.3"
>> RUBY_DESCRIPTION
=> "ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]"
@kalv
kalv / My output
Created December 11, 2012 19:12
What is going on here?
$ ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]
$ ruby test_time.rb
Parsing the timestamp 2012-12-11 18:01:54.246524000
The float compare to string formatted output: false
"1355277714.2465239"
"1355277714.246524"
@kalv
kalv / gist:1391982
Created November 24, 2011 18:32
How to turn off skype automatic gain
cd ~/Library/Application\ Support/Skype
ruby -e 'puts File.read("shared.xml").to_s.gsub("<VoiceEng>","<VoiceEng>\n<AGC>0</AGC>\n<EC>0</EC>")' > new_shared.xml
mv shared.xml shared.xml.bak
mv new_shared.xml shared.xml
@kalv
kalv / vim7.3_mac_install.rb
Created October 13, 2011 19:14 — forked from sirupsen/vim7.3_mac_install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
@kalv
kalv / gist:913392
Created April 11, 2011 11:49
Clear out Resque messages that have Decode errors.
# Use from console, was required as old messages were incorrectly encoded and placed on the failed queue
# preventing us to view the failed queue.
include Resque::Helpers
Resque::Failure.count.times do |index|
puts "Checking #{index}"
begin
decode Resque.redis.lindex(:failed, index)
rescue Resque::Helpers::DecodeException
@kalv
kalv / hex_play.rb
Created February 15, 2011 14:23
Playing with hex and characters
raw_data = <<-EOF
0000 0048 0000 0005 0000 0000 0000 0092
0001 0134 3437 3739 3935 3734 3435 3200
0101 3434 3739 3835 3133 3937 3331 0000
0000 0000 0000 0000 0f41 626f 7574 20bb
3435 302c 3030 303f
EOF
raw_data = <<-EOF
0001 0134 3437 3739 3935 3734 3435 3200
@kalv
kalv / Gemfile
Created February 14, 2011 18:11
Errors containing invalid UTF8 appear to break getexceptional (i.e. they don't appear in the interface)
source :rubygems
gem 'exceptional'
gem 'json'