Skip to content

Instantly share code, notes, and snippets.

View omgmog's full-sized avatar
⌨️

Max Glenister omgmog

⌨️
View GitHub Profile
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
function _init()
x=-40
y=64
body={1,3}
head={5,7}
s={
@omgmog
omgmog / menu-system.p8
Created February 3, 2019 00:47
Pico-8 menu system
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
-- init
function _init()
_sfx = {
select = 0,
move = 1,
no = 2
}
@omgmog
omgmog / custom-font.p8
Last active November 29, 2020 14:02
custom 5x7 font for pico8, mostly based on this font: https://www.dafont.com/type-writer.font
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
global_y = 0
function mt(t1,t2)
local new = {}
for k,v in pairs(t1) do new[k] = v end
for k,v in pairs(t2) do new[k] = v end
return new
end
@omgmog
omgmog / arkanoid.p8
Last active August 4, 2018 10:37
Arkanoid (wip) - following the Pico-8 Hero video series
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
function center(width)
return (screen_width / 2) - (width / 2)
end
function _init()
cls()
@omgmog
omgmog / cog.p8
Last active August 1, 2018 20:52
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
function sleep(s)
for i=1,s*30 do
flip()
end
end
c = 0
@omgmog
omgmog / dialog.p8
Last active August 5, 2023 06:24
Dialog system for Pico-8
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
function sleep(s)
for i=1,s*30 do
flip()
end
end
@omgmog
omgmog / app_main.c
Created July 12, 2018 19:54
Hello World example for Pocket Sprite
#include "ugui.h"
#include "8bkc-hal.h"
#include "8bkc-ugui.h"
// used later in example
float health = 100;
void app_main() {
kchal_init();
kcugui_init();
@omgmog
omgmog / slack-biggest-files.py
Created May 11, 2018 13:50
Get the 10 biggest files in a Slack workspace.
from slacker import Slacker
import itertools
from hurry.filesize import size
slack = Slacker('<API KEY>')
pages = slack.files.list(page=1).body['paging']['pages']
all_the_files = list(itertools.chain(*[slack.files.list(page=i).body['files'] for i in range(1,pages + 1)]))
@omgmog
omgmog / userChrome.css
Last active April 27, 2018 10:48
Firefox userChrome tweaks for Windows and macOS
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
window, page, dialog, wizard {
color: -moz-DialogText;
font: "SF Pro Text" !important;
}
:root:-moz-lwtheme-darktext {
--url-and-searchbar-background-color: #fff;
--chrome-background-color: #E3E4E6;
@omgmog
omgmog / jekyll-to-grav.js
Last active February 4, 2019 09:05
Port Jekyll posts to Grav CMS
const fs = require('fs');
const glob = require('glob');
const fm = require('front-matter');
const path = require('path');
const write = require('write');
glob("!(node_modules)/**/*.md", {}, (err, files) => {
files.forEach((file) => {
fs.readFile(file, 'utf8', (err, data) => {
if (err) throw err;