Skip to content

Instantly share code, notes, and snippets.

View Islati's full-sized avatar
🥷

Islati Islati

🥷
View GitHub Profile
@Islati
Islati / spintax-guide.md
Last active August 17, 2023 19:03
GPT AI Spintax Prompt (Text Generation Syntax)

Spintax

String syntax with mutliple options inline {} and through tags such as [emoji] (which generates a random smiley face from a list.

Prompt Text


When you see items encased in square brackets, such as "[smiley-face]", they translate to a random emoji that complements the tone of the message.
@Islati
Islati / challenge.js
Created May 26, 2023 09:50
Coding Challenge:: firstNonRepeatedCharacter
/*
Solution has been optimized for 0(n) speed
indexOf has a time complexity of O(n), which means that the loop
could potentially have a time complexity of O(n^2) in the worst case,
where n is the length of the input string.
To avoid this performance issue, we use a plain JavaScript object
instead of a Map to store the character count, and use a separate loop to
find the first non-repeated character
@Islati
Islati / Main.kts
Created April 10, 2022 13:16
Kotlin Bubble Sort Algoritnm
fun swap(numbers: IntArray, position: Int, nextPosition: Int): IntArray{
val tmp: Int = numbers[position]
numbers[position] = numbers[nextPosition]
numbers[nextPosition] = tmp //Puts the previous value in the swapped space
return numbers;
}
fun bubbleSort(numbers: IntArray): IntArray {
var swapped = true;
@Islati
Islati / api_uptime.py
Created November 13, 2021 16:14
Diversio Solutions
"""
Required Packages:
click
requests
python-dateutil
Execute `pip install click requests python-dateutil`
"""
import re
package net.frozenorb.qlib.util;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
@Islati
Islati / UpworkAPI.py
Created November 16, 2016 22:28
Basis for a web-requests based Upwork API for Python
import requests
import logging
from bs4 import BeautifulSoup
logger = logging.getLogger("upwork-api")
class UpworkAPI(object):
_LOGIN_URL = "https://www.upwork.com/ab/account-security/login"
@Islati
Islati / cs-jq-plugin-template.coffee
Created March 8, 2016 20:56 — forked from rjz/cs-jq-plugin-template.coffee
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->