Skip to content

Instantly share code, notes, and snippets.

View MasoodGit's full-sized avatar

Mohamed Masood Alam MasoodGit

View GitHub Profile
@MasoodGit
MasoodGit / Node.rb
Created January 4, 2016 09:16
Sample class in ruby
class Node
attr_accessor :info , :left , :right
def initialize (info,left,right)
@info = info
@left = left
@right = right
end
end
@MasoodGit
MasoodGit / image_blur.rb
Last active December 19, 2015 01:33
image_blur#1
class Image
def initialize(data)
@data = data
end
def output_image
@data.each do |row|
str = ""
@MasoodGit
MasoodGit / Deck of cards
Created December 16, 2015 10:35
Deck of cards , using class Card and Deck
class Card
attr_accessor :rank, :suit
def initialize(rank, suit)
self.rank = rank
self.suit = suit
end
def output_card
return "Card: #{self.rank} of #{self.suit}"
@MasoodGit
MasoodGit / vagrantfile
Created December 12, 2015 06:28
vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
app.directive("panelWidgetResourceSend", ["$http", "$rootScope", "$timeout", function($http) {
return {
restrict: "A",
controller: ["$scope", "$element", function($scope, $element) {
$scope.sent = !1,
$scope.sending = !1,
$scope.failed = !1,
$scope.sendResource = function($event) {
if ($scope.resource) {
if ($scope.resource.$invalid) {