Skip to content

Instantly share code, notes, and snippets.

@Davidslv
Davidslv / iga-2027-game-description.md
Created September 2, 2026 10:47
Filed Under No One — English game description for Indie Game Award 2027 (controls, introduction, mechanics, key features).

Filed Under No One

English game description — Indie Game Award 2027

A top-down stealth game. No combat. Light, shadow, and the watch.

Title Filed Under No One
Genre Top-down stealth. Single-player. No combat.
Platform Web browser (desktop). Keyboard and gamepad. English UI.
@Davidslv
Davidslv / sound_maker.js
Created October 21, 2022 22:59
Playing Sound with Javascript
class SoundMaker {
constructor() {
this.context = new AudioContext();
this.oscillator = new Oscillator(this.context);
this.gain = this.context.createGain();
this.volume = new Volume(this.context, this.gain);
}
start() {
this.oscillator.connect(this.gain);
@Davidslv
Davidslv / square-canvas.html
Created December 17, 2021 09:21
Experimenting with Canvas
<!DOCTYPE html>
<html lang="en" dir="ltr">
<body>
<canvas id="canvas" width="600" height="600"></canvas>
<script type="text/javascript">
let canvas = document.querySelector('canvas');
let context = canvas.getContext('2d');
context.fillStyle = 'blue';
# gem instal rumouse
require 'rumouse'
x, y = 1527, 612
mouse = RuMouse.new
mouse.move x, y
0.upto(500) do
sleep 0.02
print '.'
@Davidslv
Davidslv / cleanup
Last active May 1, 2019 10:35
Delete local branches - except master, staging & production
git fetch --prune
git branch --merged | grep -v '\*\|master\|staging|production' | xargs -n 1 git branch -d
// Uncompressed version of
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#include <stdbool.h> // 2008-2019
const int HEIGHT = 40;
const int WIDTH = 80;
(function() {
"use strict";
window.GOVUK = window.GOVUK || {};
var $ = window.jQuery;
function BrowseColumns(options){
if(options.$el.length === 0) return;
if($(window).width() < 640) return; // don't ajax navigation on mobile
this.$el = options.$el;
@Davidslv
Davidslv / unused_methods.rb
Last active December 1, 2016 09:35
ruby unused methods
#!/usr/bin/env ruby
require 'optparse'
module CLI
extend self
PATHS_TO_CHECK = %w(app bin config engines lib script)
EXTENSIONS_TO_CHECK_FOR_DEFINITIONS = %w(.rb .rake)
EXTENSIONS_TO_CHECK_FOR_USAGE = EXTENSIONS_TO_CHECK_FOR_DEFINITIONS + %w(.yml .yaml .erb)
@Davidslv
Davidslv / find-unused-ruby-methods.sh
Last active December 1, 2016 09:18 — forked from joelittlejohn/find-unused-clj.sh
find unused code..
#!/bin/bash
for f in $(egrep -o -R "def?-? [^ ]*" * --include '*.rb' | cut -d \ -f 2 | sort | uniq); do
echo $f $(grep -R --include '*.rb' -- "$f" * | wc -l);
done | grep " 1$"
---
- "/government/statistics/announcements/deaths-registered-by-area-of-usual-residence-in-england-and-wales-monthly-provisional-july-2014"