Skip to content

Instantly share code, notes, and snippets.

View maxoja's full-sized avatar

Tawan T. maxoja

  • Glasgow, Scotland
View GitHub Profile
@maxoja
maxoja / userDataStreams.js
Last active April 30, 2021 22:56
Satang - Failed Getting listen key
// Hi IT Team
// Thanks a lot for taking this case
// Calling generateListenKey this get 404 not found error
// If I tried https://satangcorp.com/api/v3/userDataStream (no S) I will get 401 Unauthorised error
// I also tried adding TDAX-API but didn't work as well
// There's no difference when I used apiSecret in plase of apiKey
// I made sure 'Read User Data Stream' option is enable for this apiKey
// Would be great if you can share how to do this correctly and how to extend key live since that one has a different security protocol
@maxoja
maxoja / learning.2020.10.29.txt
Created October 29, 2020 21:18
Edit code on remote server
You can setup VS code to directly access your source code on server through ssh
It's super convenient
You can also do anything on server through VS code's terminal
@maxoja
maxoja / server-setup-guide.txt
Created October 28, 2020 02:36
Personal Server Setup Guide [Nginx, SSL, IONOS, GoDaddy, Crontab]
----------------------------------
Domain Parking for IONOS Server
----------------------------------
- Go to domain & ssl section
- Add external domain
- Use Godaddy's name servers
- Add verify record on GoDaddy
- Add A record on GoDaddy linking to the server IP
* Changing DNS Records takes some time to update depending on TTL
@maxoja
maxoja / SpinAround.cs
Created September 29, 2020 18:35
Random but soothing movement Unity C# script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpinAround : MonoBehaviour
{
public float rotX, rotY, rotZ;
public float moveScale;
public Vector3 changeSpeed = Vector3.one;
private Rigidbody rb;
{
"nodes": [
{
"id": "A",
"group": 1
},
{
"id": "B",
"group": 1
},
@maxoja
maxoja / connect_to_mysql.sh
Created November 23, 2018 18:07
Connect to MySql server from terminal
mysql --host=[HOST_IP_OR_DOMAIN] --user=[USERNAME] --password
@maxoja
maxoja / MouseDrag.cs
Last active April 29, 2020 02:02
Unity Tutorial Source Code : Drag Object with Mouse
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//this script colaborates to the tutorial
//https://www.youtube.com/watch?v=pK1CbnE2VsI
public class MouseDrag : MonoBehaviour {
float distance = 10;
// .. includes
void scanValues(int* a, int* b)
{
//use scanf to get 2 input integers into address a and b
}
void conditionalSwap(int* a, int* b)
{
//swap the values if the value in a is bigger than b's
// ... includes
void scanValues(int* a, int* b, int* c)
{
}
void sort(int* a, int* b, int* c)
{
// ... includes
void scanFloat(float* f)
{
//scan a float value from console to the given address
}
void calculate(float r, float* perimeter, float* area)
{
//calculate the results based on the given r and put them into the specified addresses