Skip to content

Instantly share code, notes, and snippets.

@drhayes
drhayes / camera.lua
Created March 9, 2018 15:33
LÖVE rescale
function Camera:resize(w, h)
local dw, dh = config.graphics.width, config.graphics.height
local x, y = w / dw, h / dh
local scale = math.min(x, y)
local width, height = dw * scale, dh * scale
self.camera:setScale(scale)
local wPadding, hPadding = (w - width) / 2, (h - height) / 2
self.padding = {
x = wPadding, y = hPadding
}
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jre
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@oliverdoetsch
oliverdoetsch / AND_OR_NOT
Last active January 22, 2023 17:03
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR
@Uradamus
Uradamus / shuffle.lua
Last active November 3, 2023 09:39
A simple array shuffle function for Lua implementing the Fisher-Yates shuffle.
function shuffle(tbl)
for i = #tbl, 2, -1 do
local j = math.random(i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
return tbl
end