Skip to content

Instantly share code, notes, and snippets.

View ThisGuyCodes's full-sized avatar

Travis Johnson ThisGuyCodes

View GitHub Profile
Array.new(rows){Array.new(columns)}
Array.new(rows) do
Array.new(columns)
end
image = [
[0,0,0,0],
[0,1,0,0],
[1,0,0,0],
[0,0,0,1]
]
image.each do |row|
puts row
puts "next"
class Array
def each()
counter = 0
while counter < self.len do
yield self[counter]
counter = counter + 1
end
end
@ThisGuyCodes
ThisGuyCodes / cpucache.go
Created February 13, 2014 21:42
set incby = 64, there is no noticeable performance increase
package main
const (
length = 16777216
setto = 'x'
incby = 8
)
func main() {
array := make([]byte, length)
@ThisGuyCodes
ThisGuyCodes / hello.cpp
Created February 10, 2014 02:48
C++ 'Hello World', with no includes
extern "C" int printf (__const char *__restrict __format, ...);
int main()
{
printf("Hello world!\n");
return 0;
}