Skip to content

Instantly share code, notes, and snippets.

View darmie's full-sized avatar
🏠
Working from home

'Damilare Darmie Akinlaja darmie

🏠
Working from home
View GitHub Profile
@darmie
darmie / render_html.moon
Created April 28, 2016 14:10
Trying to create a DSL that converts to HTML
render_tags= (fn)->
setfenv fn, setmetatable({}, {
__index:(tag_name)=>
print tag_name
(opts)->
build_tag(tag_name, opts)
})
fn!
@darmie
darmie / main.lua
Last active April 14, 2016 13:50
Moving Box
local player = {} --the player object
function love.load()
player.x = 300
player.y = 400
end
function love.update(dt)
@darmie
darmie / main.lua
Created April 14, 2016 13:37
Love2D code snippet
function love.load()
myfont = love.graphics.newFont(45)
love.graphics.setFont(myfont)
love.graphics.setColor(0, 0, 0, 225)
love.graphics.setBackgroundColor(225, 153, 0)
end
function love.update()
--we are not doing anything here yet :)
end
function love.draw()
@darmie
darmie / main.lua
Last active April 14, 2016 13:36
Love2D code snippets
function love.load()
--load
end
function love.update(dt)
-- maths
end
function love.draw()
--draw
end
@darmie
darmie / instanceof.lua
Created April 9, 2016 09:29 — forked from paulcuth/instanceof.lua
Implementation of instanceof in Lua
function instanceOf (subject, super)
super = tostring(super)
local mt = getmetatable(subject)
while true do
if mt == nil then return false end
if tostring(mt) == super then return true end
mt = getmetatable(mt)
@darmie
darmie / designer.html
Created January 4, 2016 11:46
designer
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@darmie
darmie / designer.html
Last active January 4, 2016 13:41
designer
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@darmie
darmie / loadMore.js
Created November 28, 2015 10:20 — forked from fraserxu/loadMore.js
Simple load more function for ng-repeat with limitTo filter
// set the default amount of items being displayed
$scope.limit= 5;
// loadMore function
$scope.loadMore = function() {
$scope.limit = $scope.items.length
}