Skip to content

Instantly share code, notes, and snippets.

View rduv's full-sized avatar

Ravi Duvvuri rduv

View GitHub Profile
@emad-elsaid
emad-elsaid / moving-line.rb
Created March 26, 2014 13:31
Draw a Moving line with mouse using Ruby and Gosu gem
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'gosu'
include Gosu
$dimension = 200
$line_limit = 70
class GameWindow < Window
@emad-elsaid
emad-elsaid / worm.rb
Created March 19, 2014 12:15
Worm game in under 50 line of code in ruby
#!/usr/bin/env ruby
require 'gosu' # gem install gosu --no-document
include Gosu
$dimension, $splits = 200, 20
$size = $dimension.to_f / $splits.to_f
class Worm
attr_writer :dir
def initialize() reset end
@emad-elsaid
emad-elsaid / matrix.rb
Created March 16, 2014 14:28
Create Matrix Like screen using Ruby
#!/usr/bin/env ruby
require 'gosu' # gem install gosu
$width, $height = 200, 200
$number_of_v_lines,$number_of_h_lines = 10, 10
$chars = ('a'..'z').to_a
class Entity
def initialize(x,y,vel, win)
@pos, @vel = {x:x, y:y}, vel
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active September 18, 2025 20:18
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>