Skip to content

Instantly share code, notes, and snippets.

@agnel
agnel / simple_sort.rb
Created October 5, 2016 13:31 — forked from emad-elsaid/simple_sort.rb
simple sorting algorithms with ruby this is a small practice for implementing simple sorting algorithms using ruby, i grabed the Pseudocode from their respective wikipedia pages and converted them to ruby, one new thing i have learned from this simple practice is swapping arrays elements in single line of code.
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
#
# this script is a small practice in implementing
# simple sorting algorithms in ruby, i converted
# the sorting algorithms from wikipedia pages
class Array
# Insertion sort is a simple sorting algorithm that builds
# the final sorted array (or list) one item at a time.
@agnel
agnel / marray.rb
Created February 16, 2016 10:35 — forked from borowskiio/marray.rb
Produce PHP-style multidimensional array, e.g arr[1][2][3] = 'foobar'
# Produce PHP-style multidimensional array.
#
# Example
#
# arr = Marray.new
#
# arr[1][2][3] = "foo"
# => "foo"
#
# arr[1][2][3]
@agnel
agnel / dabblet.css
Created July 6, 2012 08:57 — forked from daneden/dabblet.css
Search Suggestions
/*
Search Suggestions
Original design by Visual Idiot - http://dribbble.com/shots/377281-Search-Suggestions
*/
html {
min-height: 100%;
background: -webkit-linear-gradient(#dbddde, #b6babb);
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;