Skip to content

Instantly share code, notes, and snippets.

@xriss
xriss / beep.txt
Created Sep 30, 2017
Swanky Beep example
View beep.txt
sfx.render{
["frequency"]="C4",
["name"]="shot",
["volume"]=0.5,
["duty"]=0.5,
["fwav"]="square",
["adsr"]=
{
1,
@xriss
xriss / invaders.fun.lua
Last active Sep 30, 2017
Fun64 : An invaders style space game.
View invaders.fun.lua
local wstr=require("wetgenes.string")
local chatdown=require("wetgenes.gamecake.fun.chatdown") -- conversation trees
local bitdown=require("wetgenes.gamecake.fun.bitdown") -- ascii to bitmap
local chipmunk=require("wetgenes.chipmunk") -- 2d physics https://chipmunk-physics.net/
-----------------------------------------------------------------------------
--[[#hardware
@xriss
xriss / starfield.fun.lua
Created Sep 1, 2017
Fun64 : A 2d starfield running in a shader.
View starfield.fun.lua
local wstr=require("wetgenes.string")
hardware,main=system.configurator({
mode="fun64", -- select the standard 320x240 screen using the swanky32 palette.
graphics=function() return graphics end,
update=function() update() end, -- called repeatedly to update+draw
})
-- debug text dump
@xriss
xriss / palette.fun.lua
Last active Aug 11, 2017
Fun64 : A data dump of the Swanky32 palette.
View palette.fun.lua
--
-- This is fun64 code, you can copy paste it into https://xriss.github.io/fun64/pad/ to run it.
--
hardware,main=system.configurator({
mode="fun64", -- select the standard 320x240 screen using the swanky32 palette.
update=function() update() end, -- called repeatedly to update+draw
})
local wstr=require("wetgenes.string")
@xriss
xriss / shadertoy.fun.lua
Last active Aug 10, 2017
Fun64 : testing the background copper using shadertoy code.
View shadertoy.fun.lua
local wstr=require("wetgenes.string")
local wgrd=require("wetgenes.grd")
local tardis=require("wetgenes.tardis") -- matrix/vector math
local bitdown=require("wetgenes.gamecake.fun.bitdown")
local bitdown_font_4x8=require("wetgenes.gamecake.fun.bitdown_font_4x8")
--
@xriss
xriss / 0_reuse_code.js
Created Jun 10, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xriss
xriss / helloworld.fun.lua
Last active Aug 10, 2017
Fun64 Hello World test code
View helloworld.fun.lua
--
-- This is fun64 code, you can copy paste it into https://xriss.github.io/fun64/pad/ to run it.
--
hardware,main=system.configurator({
mode="fun64", -- select the standard 320x240 screen using the swanky32 palette.
update=function() update() end, -- called repeatedly to update+draw
})
-- we will call this once in the update function
View gist:8054b0a96a2e2781ecec18e0e74e0cd7
sudo install -o root -g root -m 0600 /dev/null /swapfile
dd if=/dev/zero of=/swapfile bs=1k count=256k
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap auto 0 0" | sudo tee -a /etc/fstab
sudo sysctl -w vm.swappiness=10
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
@xriss
xriss / froxy.sh
Last active Jun 30, 2016
Use ssh to run a socks proxy, locked down by IP, probably running on a NAT VPS.
View froxy.sh
# Use ssh to run a socks proxy, locked down by IP, probably running on a NAT VPS.
# note that this script shouid be run inside byobu for longterm proxying
# beware that you will need to stop and then run this script again if your IP changes.
# the port to share on must be in valid range for your nat vps
# use this combined with the public ip to connect a browser to this socks server
PORT=1001
# find your public ip here-> https://www.google.com/search?q=what+is+my+ip
@xriss
xriss / bartop.js
Last active Dec 16, 2015
chartjs v2 - bartop controller that displays value at top of bar chart using y axis formating
View bartop.js
(function() {
"use strict";
var root = this,
Chart = root.Chart,
helpers = Chart.helpers;
Chart.defaults.bartop = helpers.extendDeep({},Chart.defaults.bar);