This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Uppgift 4 av Johan Nordström | |
require 'mysql' | |
$places = {} # Håller koll på elmätaren för platsen | |
$guests = [] # Håller reda på samtliga gäster | |
class DatabaseController | |
attr_reader :dbh, :connected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'mysql' | |
class DatabaseController | |
attr_reader :dbh, :connected | |
def initialize(hostname, user, password, db, table) | |
@hostname, @user, @password, @db, @table = hostname, user, password, db, table | |
@connected = false | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
-- @file awesomerc.lua | |
-- @author Gigamo <gigamo@gmail.com> | |
------------------------------------------------------------------------------- | |
-- {{{1 Tables | |
local tags = { } | |
local statusbar = { } | |
local promptbox = { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
-- @file awesomerc.lua | |
-- @author Gigamo <gigamo@gmail.com> | |
------------------------------------------------------------------------------- | |
-- {{{1 Tables | |
local tags = { } | |
local statusbar = { } | |
local promptbox = { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
-- @file awesomerc.lua | |
-- @author Gigamo <gigamo@gmail.com> | |
------------------------------------------------------------------------------- | |
-- {{{1 Tables | |
local tags = { } | |
local statusbar = { } | |
local promptbox = { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
-- @file rc.lua | |
-- @author Matthew Wild <mwild1@gmail.com> | |
------------------------------------------------------------------------------- | |
local rc, err = loadfile(os.getenv("HOME").."/.config/awesome/awesomerc.lua"); | |
if rc then | |
rc, err = pcall(rc); | |
if rc then | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
abort 'nu-uh' if ARGV.empty? | |
%w[net/ftp rubygems progressbar highline/import].each {|l| require l} | |
conf = { | |
:host => 'localhost', | |
:user => 'jolts', | |
:pass => 'test', | |
:rdir => '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
abort 'ang map baka' if ARGV.empty? | |
%w[net/ftp].each {|l| require l} | |
conf = { | |
:host => '127.0.0.1', | |
:user => 'jolts', | |
:pass => 'test', | |
:rdir => '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'rubygems' | |
{ | |
:fileutils => ['fileutils', true] | |
}.each do |key, info| | |
path, required = info[0, 2] | |
$have_lib ||= {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
$:.unshift File.dirname(__FILE__) + '/..' | |
require 'bin/usbsyncer.rb' | |
require 'test/unit' | |
class TestUsbSyncer < Test::Unit::TestCase | |
def setup | |
@usbsyncer = UsbSyncer::Device.new(/Cruzer Micro/) |
NewerOlder