Skip to content

Instantly share code, notes, and snippets.

View irealworlds's full-sized avatar
🎯
Focusing

Marin Călin irealworlds

🎯
Focusing
View GitHub Profile
<?php
/*
* This document has been generated with
* https://mlocati.github.io/php-cs-fixer-configurator/#version:3.12.0|configurator
* you can change this configuration by importing this file.
*/
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setRules([
@irealworlds
irealworlds / including.ts
Created November 11, 2020 13:27
Include files inside HTML, using a new custom tag, <include component="path">.
// Fix Array.from not being defined.
interface ArrayConstructor {
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
from<T>(arrayLike: ArrayLike<T>): Array<T>;
}
window.addEventListener("load", () => {
const needIncluding = Array.from(document.getElementsByTagName("include"));
for (const include of needIncluding) {
includeFile(include.getAttribute("component"), include);
@irealworlds
irealworlds / trees.js
Created August 1, 2020 18:51
A function that helps quickly create trees in javascript, with a minimum amount of HTML required.
const CreateTree = element => {
const clickEvent = new Event('click');
const openedClass = 'fa-minus-circle';
const closedClass = 'fa-plus-circle';
//initialize each of the top levels
element.classList.add('tree');
for (let child of element.querySelectorAll('li')) {
if (child.getElementsByTagName('ul').length) {
const newNode = document.createElement('i');
@irealworlds
irealworlds / ProgressBar.cs
Last active March 30, 2019 12:27 — forked from ikkentim/ProgressBar.cs
SA-MP progress bar converted to C#
using SampSharp.GameMode;
using SampSharp.GameMode.Display;
using SampSharp.GameMode.SAMP;
using SampSharp.GameMode.World;
using System;
namespace YourNamespace
{
public class ProgressBar : IDisposable
{