Skip to content

Instantly share code, notes, and snippets.

@xriss
xriss / bartop.js
Last active December 16, 2015 14:00
chartjs v2 - bartop controller that displays value at top of bar chart using y axis formating
(function() {
"use strict";
var root = this,
Chart = root.Chart,
helpers = Chart.helpers;
Chart.defaults.bartop = helpers.extendDeep({},Chart.defaults.bar);
@xriss
xriss / froxy.sh
Last active June 30, 2016 18:42
Use ssh to run a socks proxy, locked down by IP, probably running on a NAT VPS.
# 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
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 / index.html
Last active September 16, 2016 21:00
Bouncing Ball// source http://jsbin.com/lagahi
<html>
<head>
<title>Bouncing Ball</title>
<script data-pace-options='{ "eventLag": false }' src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js"></script>
<style>
.pace .pace-progress { height:4px; background:#88f; position:fixed; z-index:9999; top:0; right:100%; width:100%; }
.pace-inactive { display:none; }
.pace { -webkit-pointer-events:none; pointer-events:none; -webkit-user-select:none; -moz-user-select:none; user-select:none; }
</style>
</head>
@xriss
xriss / 0_reuse_code.js
Created June 10, 2017 20:18
Here are some things you can do with Gists in GistBox.
// 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 August 10, 2017 14:03
Fun64 Hello World test code
--
-- 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
@xriss
xriss / shadertoy.fun.lua
Last active August 10, 2017 22:45
Fun64 : testing the background copper using shadertoy code.
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 / palette.fun.lua
Last active August 11, 2017 21:06
Fun64 : A data dump of the Swanky32 palette.
--
-- 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 / starfield.fun.lua
Created September 1, 2017 13:59
Fun64 : A 2d starfield running in a shader.
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 / beep.txt
Created September 30, 2017 09:23
Swanky Beep example
sfx.render{
["frequency"]="C4",
["name"]="shot",
["volume"]=0.5,
["duty"]=0.5,
["fwav"]="square",
["adsr"]=
{
1,