This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/will_paginate.rb | |
# tested with will_paginate 2.3 stable | |
module WillPaginate | |
class BootstrapLinkRenderer < LinkRenderer | |
def to_html | |
links = @options[:page_links] ? windowed_links : [] | |
# previous/next buttons | |
links.unshift page_link_or_span(@collection.previous_page, 'disabled prev', "← Previous") | |
links.push page_link_or_span(@collection.next_page, 'disabled next', "Next →") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'midilib' | |
require 'simple-random' | |
include MIDI | |
def get_number | |
rand(2000) | |
end | |
seq = nil unless seq.nil? | |
seq = Sequence.new() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following are the current stages | |
# FE: after instruction is fetched | |
# ID: after instruction is added to scheduler | |
# IS: instruction is selected for execution | |
# EX: instruction finished execution | |
# WB: instruction retired | |
# Dont be confused by ID_stage, Op is added to scheduler in IS_stage, just easier | |
# to differentiate in the parsing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Dump format should be like this | |
# (STAGE) OP (OP_ID) ... cycle (CYCLE) | |
# Matching is case insensitive | |
# | |
# Examples: | |
# FE_STAGE OP 0 is fetched at cycle 1 | |
# ID_STAGE OP 0 is scheduled at cycle 3 | |
# IS_STAGE OP 0 is issued at cycle 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Search upwards for $1 in directory tree. | |
pwd="`pwd`" | |
start="$pwd" | |
while [ ! "$pwd" -ef .. ]; do | |
[ -e "$1" ] && echo -n "$pwd" && exit | |
cd .. || exit 1 | |
pwd="`pwd`" |