Skip to content

Instantly share code, notes, and snippets.

View giokaxo's full-sized avatar
👨‍🚀

Giorgi Kakhoshvili giokaxo

👨‍🚀
View GitHub Profile
@giokaxo
giokaxo / locales.ts
Last active November 27, 2023 13:09
ISO-639-1 and BCP-47 locale enums
export type ISO6391 =
| 'ab'
| 'aa'
| 'af'
| 'ak'
| 'sq'
| 'am'
| 'ar'
| 'an'
| 'hy'
@giokaxo
giokaxo / tasks.json
Created December 8, 2022 10:51
Run current test VS Code Task
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"command": "yarn",
"args": [
{
"value": "test:unit",
"quoting": "strong"
@giokaxo
giokaxo / Challenges.ts
Created August 5, 2022 20:05
Typescript challenges
// type First<T extends unknown[]> = T extends { length: 0 } ? never : T[0];
// type arr1 = ['a', 'b', 'c']
// type arr2 = [3, 2, 1]
// type head1 = First<arr1> // expected to be 'a'
// type head2 = First<arr2> // expected to be 3
@giokaxo
giokaxo / slugify.js
Last active September 23, 2019 11:00 — forked from hagemann/slugify.js
Slugify makes a string URI-friendly
function slugify(string) {
const a = 'აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰ·/_,:;'
const b = 'abgdevztiklmnopjrstufqgkscczwwxjh------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
@giokaxo
giokaxo / php-code-inspection.md
Created April 20, 2017 17:51
How to install PHP code inspection tools using homebrew-php and how to integrate with JetBrain's IntelliJ or PhpStorm

#Inspection Tools with homebrew-php#

##Prerequisites##

  • Homebrew is installed

##Step 1: Installing homebrew-php##

  1. brew tap homebrew/dupes
  2. brew tap josegonzalez/homebrew-php
  3. brew install PHP53 (or other version of your choice)