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 / ff2cv.cpp
Created January 3, 2020 23:30 — forked from yohhoy/ff2cv.cpp
Read video frame with FFmpeg and convert to OpenCV image
/*
* Read video frame with FFmpeg and convert to OpenCV image
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>
@darmie
darmie / RuleParser.hx
Created August 31, 2018 16:37 — forked from anissen/RuleParser.hx
Parse toy rule language using hxparse
/*
Syntax:
if (condition) then (action)
if [(condition), (condition)] then [(action), (action)]
*/
/*
Testing:
function testRule(correct :Bool, s :String) {
@darmie
darmie / TextField.hx
Created September 10, 2017 20:15 — forked from tienery/TextField.hx
TextField class using Kha in Haxe
package render;
import kha.Key;
import kha.input.Keyboard;
import kha.Font;
import kha.Color;
import kha.input.Mouse;
import kha.graphics2.Graphics;
class TextField
@darmie
darmie / CountryCodes.json
Created May 18, 2017 00:08 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375","
@darmie
darmie / Contract Killer 3.md
Created October 17, 2016 18:35 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@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 / 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 / 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
}