Skip to content

Instantly share code, notes, and snippets.

View TomasKostadinov's full-sized avatar
💻
Currently fixing in production

Tomas Kostadinov TomasKostadinov

💻
Currently fixing in production
View GitHub Profile
@TomasKostadinov
TomasKostadinov / SetDeploymentHashENVVariables.ps1
Created November 9, 2023 09:15
Set Depyoment Variables in Angular App
[CmdletBinding()]
param (
# [Parameter()]
# [string]
$CommitHash,
$DeploymentTime
)
$environmentFiles = @(
@TomasKostadinov
TomasKostadinov / typescript-node-check.ts
Created May 10, 2023 12:11
Find out what type of typescript-node your current node is
import * as ts from 'typescript';
function whatTypeOfNodeIsIt(node: ts.Node) {
const functions = [
ts.isNumericLiteral,
ts.isBigIntLiteral,
ts.isStringLiteral,
ts.isJsxText,
ts.isRegularExpressionLiteral,
ts.isNoSubstitutionTemplateLiteral,
@TomasKostadinov
TomasKostadinov / load-stylesheet-async.func.ts
Last active February 2, 2021 16:59
Load Stylesheets in Angular Asynchronously
export async function loadStyleSheets(items: StyleSheetLoadingItem[]) {
items.forEach((item) => {
loadStyleSheet(item.stylePath, item.elementName);
});
}
async function loadStyleSheet(styleModule: Promise<{ default: string }>, elementName: string = '') {
// Import style if not already done
if (document.getElementById(elementName) == null) {
// @ts-ignore
@TomasKostadinov
TomasKostadinov / index.html
Created January 15, 2021 20:41
Multi-Sidebar TailwindCss application layout https://play.tailwindcss.com/DJXrYoWBKa
<div class="h-screen flex overflow-hidden bg-gray-100">
<div class="hidden md:flex md:flex-shrink-0">
<div class="flex flex-col w-64 h-screen text-white">
<div class="flex flex-col flex-grow bg-black p-4 border-r-2 overflow-y-auto">
<div class="my-20">Outer Sidebar</div>
<div class="my-20">Outer Sidebar</div>
<div class="my-20">Outer Sidebar</div>
<div class="my-20">Outer Sidebar</div>
<div class="my-20">Outer Sidebar</div>
@TomasKostadinov
TomasKostadinov / config.interface.ts
Last active August 27, 2020 07:12
Typescript Log Class
export interface Configuration {
logging?: boolean;
}
@TomasKostadinov
TomasKostadinov / template.php
Created July 27, 2020 08:32
ProcessWire PHPStorm Autocomplete Vars
<?php
/**
* @var \ProcessWire\Config $config
* @var \ProcessWire\Fieldgroups $fieldgroups
* @var \ProcessWire\Fields $fields
* @var \ProcessWire\Languages $languages
* @var \ProcessWire\Modules $modules
* @var \ProcessWire\Page $page
* @var \ProcessWire\Pages $pages
* @var \ProcessWire\Paths $urls
@TomasKostadinov
TomasKostadinov / _init.php
Created March 30, 2020 13:04
Export/Import a translatable csv in ProcessWire
<?php
include_once "path/to/import.php";
include_once "path/to/export.php";
// call the functions like this
if (isset($_GET["export"])) {
$forceDownload = isset($_GET["force"]);
$debug = isset($_GET["debug"]);
renderExport($pages, $forceDownload, $debug);
@TomasKostadinov
TomasKostadinov / Rane72 Spotify.scpt
Last active January 30, 2019 15:39
Using a Rane 72 to Control Spotify
on runme(message)
if (item 1 of message = 191) and (item 2 of message = 0) and (item 3 of message = 65) then
tell application "Spotify"
next track
end tell
end if
if (item 1 of message = 191) and (item 2 of message = 0) and (item 3 of message = 63) then
tell application "Spotify"
previous track
end tell