Skip to content

Instantly share code, notes, and snippets.

@denilsonsa
denilsonsa / index.html
Last active September 10, 2021 12:00
getElementsByClassName vs getElementById vs querySelector (http://jsbench.github.io/#6fdcc5a726220a85eb7c6a00e955d532) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>getElementsByClassName vs getElementById vs querySelector</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@denilsonsa
denilsonsa / Demo.md
Last active January 10, 2018 17:11
Markdown rendering of code block inside nested list

Demonstration of a bug in GitLab's Markdown rendering.

I have a nested list, and a code block in the middle of the list.

  1. Numbered list
    • Nested list

        Code block inside the nested list
        This code block works fine.
      
@denilsonsa
denilsonsa / README.md
Last active January 24, 2022 10:00
Train Conductor World - tiled map

[Train Conductor World][tcw] is mobile game (for [iOS][ios] and [Android][and]) by [The Voxel Agents][tva]. The game has several cities on a world map (currently, only European cities).

This project (i.e. this GitHub Gist) is an effort to replicate the game world map outside the game. For that, I've used [Tiled Map Editor][tiled] to rebuild the map, and [Gimp][gimp] to create the graphics. This map can be used in the future to help planning in-game routes.

The graphics are based on [in-game screenshots][ss]. The graphics can be redone in a better quality by someone with better drawing skills.

@denilsonsa
denilsonsa / path_normalize_by_string_manipulation.pl
Last active February 27, 2024 07:59
How to normalize a path in Perl? (without checking the filesystem)
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
# https://stackoverflow.com/questions/45631519/how-to-normalize-a-path-in-perl-without-checking-the-filesystem
my %solutions = (
denilson_answer => sub {
@denilsonsa
denilsonsa / 9verdades1mentira.ipynb
Last active April 22, 2017 01:31
9 verdades e 1 mentira, testadas usando pythonlogica
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@denilsonsa
denilsonsa / moneylog_convert.py
Created June 14, 2016 10:36
moneylog_convert.py que usei até final de 2014
#!/usr/bin/env python2
# -*- coding: utf8 -*-
from __future__ import unicode_literals
import sys
from datetime import date, timedelta
import re
@denilsonsa
denilsonsa / README.md
Last active March 26, 2024 22:04
Embed VTT subtitles into HTML

Objective

I have a video file on my local disk. I also have some subtitles (in HTML5's [WebVTT][] format).

I want to create an HTML file to play that video with subtitles, all from the local filesystem.

Problem

Loading an external VTT file from the local filesystem [fails due to same-origin policy][q].

@denilsonsa
denilsonsa / README.md
Last active March 20, 2016 06:21
Videosub hack to play embedded .SRT subtitles in HTML5 video
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@denilsonsa
denilsonsa / README.md
Last active October 1, 2015 16:24
Help setting up 2 asymmetrical displays with nvidia GTX 550

Posted: http://forum.scssoft.com/viewtopic.php?f=111&t=191979

I'm trying to setup 2 displays with multimon in ETS2, but I'm failing. Well, I've managed to configure the custom multimon layout, but I can't figure out how to make ETS2 window expand to both displays.

My system:

  • Windows 7 64-bit
  • Nvidia GTX 550 Ti
  • Main HDMI monitor at 1920 x 1080
  • Secondary DVI monitor at 800 x 1280