Skip to content

Instantly share code, notes, and snippets.

View dinukapj's full-sized avatar

Dinuka Jay dinukapj

View GitHub Profile
@dinukapj
dinukapj / RetrofitSingleton.java
Last active September 16, 2022 09:20
Retrofit Singleton implementation with support for extensible API classes.
/*
* Supports reusability of a retrofit instance and allows the usage of an authenticated/public retrofit instance for endpoints requiring authentication or for endpoints that are public.
* Objective was to provide maximum reusability of retrofit while avoiding issues such as duplicate POST requests or usage of expired access tokens.
*/
/*
Problem/Objectives:
- I needed global access to a retrofit instance without having to re-initialise an instance every time
@dinukapj
dinukapj / makers.js
Last active May 14, 2019 00:48
Makers
$(document).ready(function () {
var span_maker_box = document.createElement('span');
span_maker_box.classList.add('makers-box');
span_maker_box.id = 'makers-box';
var span_made_by = document.createElement('span');
span_made_by.classList.add('maker-link');
var p_made_by = document.createElement('p');
@dinukapj
dinukapj / makers.css
Last active December 14, 2018 04:25
Makers CSS
.makers-box {
right: 0;
bottom: 0;
background-color: #ff4742;
color: #fff;
position: fixed;
font-weight: 500;
z-index: 20;
border-top-left-radius: 5px;
padding: 0.5em;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlayerMovement : MonoBehaviour
{
//SWIPE CONTROLS
private Animator anim;
@dinukapj
dinukapj / timezones.html
Last active January 16, 2020 23:18
Timezones List (Based on Olson tz database)
<select id="page_input_timezone" name="timezone_offset" id="timezone-offset" class="span5">
<option disabled selected style='display:none;'>Select timezone</option>
<optgroup label="US (Common)">
<option value="America/Puerto_Rico">Puerto Rico (Atlantic)</option>
<option value="America/New_York">New York (Eastern)</option>
<option value="America/Chicago">Chicago (Central)</option>
<option value="America/Denver">Denver (Mountain)</option>
<option value="America/Phoenix">Phoenix (MST)</option>
<option value="America/Los_Angeles">Los Angeles (Pacific)</option>
public Rigidbody rigidBody;
public KeyCode forwardKey = KeyCode.A;
public float speed = 20;
// Start is called before the first frame update
void Start()
{
}
@dinukapj
dinukapj / Goaper.cs
Last active July 4, 2021 17:47
Goal Oriented Action Planning. Simple implementation of GOAP in Unity 3D
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
using System;
public class Goaper : MonoBehaviour
{
[TitleGroup("Parameters")]
[OnValueChanged("OnParameterChanged")]
public List<Parameter> parameters = new List<Parameter>();
@dinukapj
dinukapj / SceneGUIBezierInspector.cs
Created May 17, 2021 07:27
Unity In-editor area/location mapping tool that allows you to identify different parts of a large level
//NOTE: Place this script inside the Editor folder in your Scripts folder. If you don't have one, you can create a folder name Editor
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(SceneMapper))]
public class SceneGUIBezierInspector : Editor
{
void OnSceneGUI()
{
public static class AudioFadeScript
{
public static IEnumerator FadeOut(AudioSource audioSource, float FadeTime)
{
float startVolume = audioSource.volume;
while (audioSource.volume > 0)
{
audioSource.volume -= startVolume * Time.deltaTime / FadeTime;
SQL Server 2017
----------------
Enterprise Core - 6GPYM-VHN83-PHDM2-Q9T2R-KBV83
Developer - 22222-00000-00000-00000-00000
Enterprise - TDKQD-PKV44-PJT4N-TCJG2-3YJ6B
Standard - PHDV4-3VJWD-N7JVP-FGPKY-XBV89
Web - WV79P-7K6YG-T7QFN-M3WHF-37BXC
https://www.teamos-hkrg.com/index.php?threads/microsoft-sql-server-english-2017-rtm-teamos.42103/