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 'benchmark' | |
Benchmark.bmbm do |x| | |
x.report("Stripping /n with String.strip") { 100_000.times {"filename.rb\n".strip} } | |
x.report("Stripping /n with String.chomp") { 100_000.times {"filename.rb\n".chomp} } | |
end |
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 'benchmark' | |
Benchmark.bmbm do |x| | |
x.report('Break') do | |
1_000_000.times do | |
break | |
end | |
end |
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
def fizzbuzz(n) | |
(1..n).each do |i| | |
if i % 15 == 0 | |
puts 'fizzbuzz' | |
elsif i % 5 == 0 | |
puts 'buzz' | |
elsif i % 3 == 3 | |
puts 'fizz' | |
else | |
puts i.to_s |
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
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% end %> |
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
.dseg | |
.org 0x2000 | |
output: .byte 1 ; insert comment | |
.cseg | |
.org 0x0 | |
jmp main ; partial vector table at address 0x0 | |
.org 0x200 ; main entry point at address 0x200 (step though the code) | |
main: ldi ZL,low(2*table) ; insert comment | |
ldi ZH,high(2*table) ; insert comment | |
ldi r16,celsius ; insert comment |
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
/* | |
* midterm.asm | |
* | |
* Created: 6/20/2014 11:41:46 AM | |
* Author: Josh | |
*/ | |
.org 0x0 | |
ldi r30,0x00 | |
ldi r31,0x10 |
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
/* | |
* midterm.asm | |
* | |
* Created: 6/20/2014 11:41:46 AM | |
* Author: Josh | |
*/ | |
.org 0x0 | |
ldi r29,0x00 | |
ldi r30,0x10 |
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
OPT MEX expand macro calling | |
OPT SEX expand structured statements | |
CODE EQU 0 define code and text sections | |
TEXT EQU 1 | |
CR EQU $0D define CR and LF | |
LF EQU $0A | |
SECTION TEXT | |
ORG $800 sets the address for text code | |
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
;; -*- mode: dotspacemacs -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration." | |
(setq-default | |
;; List of additional paths where to look for configuration layers. | |
;; Paths must have a trailing slash (ie. `~/.mycontribs/') | |
dotspacemacs-configuration-layer-path '() |
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
;; -*- mode: dotspacemacs -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration." | |
(setq-default | |
;; List of additional paths where to look for configuration layers. | |
;; Paths must have a trailing slash (ie. `~/.mycontribs/') | |
dotspacemacs-configuration-layer-path '() |
OlderNewer