Skip to content

Instantly share code, notes, and snippets.

View who_is_online
# Defining the keys
def current_key
key(Time.now.strftime("%M"))
end
def keys_in_last_5_minutes
now = Time.now
times = (0..5).collect {|n| now - n.minutes }
times.collect{ |t| key(t.strftime("%M")) }
@biruwon
biruwon / truncate.js
Created May 23, 2013
jQuery truncate
View truncate.js
<script>
(function($){
$.fn.truncate = function(options) {
var defaults = {
length: 330,
minTrail: 0,
ellipsisText: "..."
};
var options = $.extend(defaults, options);
You can’t perform that action at this time.