This file contains hidden or 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
| Copyright 2011 Emmanuel Oga. | |
| Licensed under a Creative Commons Attribution 3.0 | |
| Unported License (http://creativecommons.org/licenses/by/3.0/). | |
| You are free: | |
| to Share — to copy, distribute and transmit the work | |
| to Remix — to adapt the work |
This file contains hidden or 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
| -- @josefnpat's Lua OOP example | |
| -- Example of base class | |
| local vehicleclass = { | |
| -- Example of class variable | |
| _defaultColor = "blue" | |
| } | |
| function vehicleclass.new(init) |
This file contains hidden or 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
| # Copyright 2017 Josef N Patoprsty | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: | |
| # | |
| # The above copyright notice and this permission notice shall be included in all |
This file contains hidden or 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
| #!/bin/sh | |
| # Copyright (c) 2014 Josef Patorpsty | |
| # | |
| # This software is provided 'as-is', without any express or implied | |
| # warranty. In no event will the authors be held liable for any damages | |
| # arising from the use of this software. | |
| # | |
| # Permission is granted to anyone to use this software for any purpose, | |
| # including commercial applications, and to alter it and redistribute it |
This file contains hidden or 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
| *.swp |
This file contains hidden or 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
| -- implementation | |
| function class(i) | |
| local c = {fields={},field_types={}} | |
| assert(type(i)=="table","class expects a table input.") | |
| for type_name,default_value in pairs(i) do | |
| local t,n = nil,nil | |
| string.gsub( | |
| type_name, | |
| "(%l*)(%l*)", |
This file contains hidden or 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
| function SourceFromTone(tone_in_hz) | |
| local rate = 44100 | |
| local samples = math.floor((rate / tone_in_hz) + 0.5) | |
| tone_in_hz = rate / samples | |
| local data = love.sound.newSoundData(samples, rate) | |
| --print(samples, rate, tone_in_hz) | |
| for i = 0, samples do | |
| local value = (i * math.pi * tone_in_hz) / (rate / 2) | |
| --print(value, math.sin(value)) |
This file contains hidden or 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
| function love.conf(t) | |
| t.version = "0.9.2" | |
| t.window.title = "Screen Brightness" | |
| t.window.width = 400 | |
| t.window.height = 32 | |
| end |
This file contains hidden or 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
| *.swp |