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 / 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
}
@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 / 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 / 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 / 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 / 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:50
Moving Box
local player = {} --the player object
function love.load()
player.x = 300
player.y = 400
end
function love.update(dt)
@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 / html.lua
Created July 28, 2016 21:39 — forked from soulik/html.lua
HTML/XML grammar LPEG parser for Lua
local lpeg = require 'lpeg'
local L = lpeg.locale()
local P,V,C,Ct,S,R,Cg,Cc =
lpeg.P, lpeg.V, lpeg.C, lpeg.Ct, lpeg.S, lpeg.R, lpeg.Cg, lpeg.Cc
local ws = S'\r\n\f\t\v '
local ws0 = ws^0
local ws1 = ws^1
local name = S'_ ' + L.digit + L.alpha
@darmie
darmie / CREATE EVENT
Last active September 19, 2016 15:40
Create a new Game Maker object for sending usage status to iConcept
var map = ds_map_create();
ds_map_add(map, "Content-Type", "application/json");
var date = string(current_day);
var data = '{"IMEI": 0, "Package":"com.saltgaming.hero_of_the_north", "date":'+ date+ '}'
global.check_usage = http_request("http://46.38.168.148:3452/emts/game/requsage","POST", map, json_encode(data));