Skip to content

Instantly share code, notes, and snippets.

@bdlabs
bdlabs / simple-canvas-rotation.html
Created February 23, 2023 20:56 — forked from geoffb/simple-canvas-rotation.html
A simple example of rotating a rectangle using HTML5 canvas.
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Canvas Transformation</title>
</head>
<body>
<script>
// Create our canvas and append it to the document body
var stage = document.createElement("canvas");
@bdlabs
bdlabs / .git_commit_template
Created May 6, 2022 12:15 — forked from tarecord/.git_commit_template
A template to help you write better commits
######## Subject Line (50 characters) ############
# - Use the imperative mood (imagine the words "This will")
# - Capitalize the first letter
# - Limit to 50 characters
# - Do not end the subject line with a period
######## The Body (72 characters per line) #############################
# - Add line breaks so each line is a maximum of 72 characters
@bdlabs
bdlabs / TrueColour.md
Created February 7, 2022 14:04 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Most updated version is always available at termstandard/colors repository.

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit truecolor: "888" colors (aka 16 million)
<?php
/**
* CC-BY 3.0 Alfonso J. Ramos (theraot)
* UTF8
*/
final class UTF8
{
//------------------------------------------------------------
// Private (Class)
//------------------------------------------------------------
@bdlabs
bdlabs / Parser.cs
Created December 18, 2021 23:39 — forked from theraot/Parser.cs
#r "nuget:Theraot.Core/3.0.3"
// This file is for RoslynPad
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Theraot.Core;
<?php
/**
* CC-BY 3.0 Alfonso J. Ramos (theraot)
* Parser
*/
final class Parser
{
//------------------------------------------------------------
// Private (Class)
//------------------------------------------------------------
<?php
define('XDEBUG', "xdebug");
define('ZEND_DEBUGGER', "Zend Debugger");
function createXmlHeader()
{
return "<?xml version=\"1.0\"?>";
}
@bdlabs
bdlabs / .htaccess
Created November 9, 2019 20:48 — forked from Padam87/.htaccess
Symfony htaccess
# Use the front controller as index file. It serves as fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# startpage (path "/") because otherwise Apache will apply the rewritting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
<IfModule mod_dir.c>
DirectoryIndex app.php
</IfModule>
<IfModule mod_authz_core.c>
@bdlabs
bdlabs / easing.js
Created May 1, 2019 12:20 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity