Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Work in progress, not for production -->
<MediaTrace version="0.7.74">
<items offset="0" name="Generic section header" size="1664">
<items offset="0" name="File information" size="768">
<item offset="0" name="Magic number">XPDS</item>
<item offset="4" name="Offset to image data">2048</item>
<item offset="8" name="Version number of header format">V2.0</item>
<item offset="16" name="Total image file size">12443648</item>
<item offset="20" name="Ditto Key">16777216</item>
@PWSdelta
PWSdelta / json_response_handling_ruby.rb
Created December 11, 2013 14:20
Ruby script that uses open-uri to fetch the contents of a JSON endpoint, uses the JSON gem to parse the string into a Ruby array & prints some of the records. This is the foundation for all web API requests, so feel free to use it in the future.
# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html
require 'open-uri'
# https://github.com/flori/json
require 'json'
# http://stackoverflow.com/questions/9008847/what-is-difference-between-p-and-pp
require 'pp'
# Construct the URL we'll be calling
request_uri = 'http://localhost:3000/users.json'
request_query = ''
@blake41
blake41 / sort.rb
Last active December 30, 2015 03:29
sorting algorithms
# Build your own sort method. It does not have to be fancy, any sort will do.
# There are many listed here: http://en.wikipedia.org/wiki/Sorting_algorithm#Summaries_of_popular_sorting_algorithms
# insertion sort or selection sort are probably easiest
# The purpose is to let the user customize how you sort the array by submitting a block that tells you which
# element goes first.
#
# If a block is given , it should use the block to determine what order the elements should be sorted by
#
# Rules for spaceship operator (Java calls it compareTo):
@blake41
blake41 / game of life.txt
Last active December 30, 2015 01:18
Game of life
One of the projects you can choose from this week is called the game of life
This is a classic problem you can do in any programming language.
http://en.wikipedia.org/wiki/Conway's_Game_of_Life
This is a good tutorial on game of life and how to use the Gosu gem to create a visualization of your game of life
http://www.youtube.com/watch?v=J5fesJ3wM6s
This is a great project to practice TDD on although it will be hard until we cover mocking and stubbing (advanced testing techniques)
@blake41
blake41 / maze.txt
Last active December 28, 2015 19:38
Build a maze solver
###########
# #
# ##### # #
# # #
### # ### #
# # #
# # ### ###
# # #
# ### # # #
# # #