Skip to content

Instantly share code, notes, and snippets.

View instance-id's full-sized avatar

instance.id instance-id

View GitHub Profile
@instance-id
instance-id / zshrc
Last active May 8, 2019 01:12
zshrc
#!/bin/zsh
check_command() {
command -v $1 > /dev/null 2>&1
}
export ZSH=$HOME/.oh-my-zsh
# // --- Different settings for SSH ------------
if [[ -n $SSH_CONNECTION ]]; then
@instance-id
instance-id / useful.sh
Last active January 5, 2021 09:21
Useful Linux stuff
cat ~/.ssh/id_rsa.pub | ssh name@server_ip_address "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
sudo apt install timeshift
sudo timeshift --create --comments "A new backup" --tags D
# --tags D stands for Daily Backup
# --tags W stands for Weekly Backup
# --tags M stands for Monthly Backup
# --tags O stands for On-demand Backup
# sudo timeshift --restore
@instance-id
instance-id / dev-server-setup.sh
Last active May 17, 2019 00:53
WIP server setup
#!/bin/bash
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y \
apt-transport-https \
curl \
ca-certificates \
build-essential \
software-properties-common \
file \
@instance-id
instance-id / python-pyodbc.sh
Last active May 17, 2019 23:24
python-pyodbc
sudo apt install libsqliteodbc
sudo apt install -f unixodbc-dev unixodbc libodbc1
sudo apt install python-pyodbc
sudo apt install update
sudo su
curl https://packages.microsoft.com/config/ubuntu/18.10/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
@instance-id
instance-id / CompilationTimer.cs
Created August 11, 2019 02:52
Simple compilation time for Unity. Just pop it into an Editor folder and it should give you a simple output of how long it took to compile your code each time.
using System;
using UnityEngine;
using UnityEditor;
namespace instance.id.Editor
{
[InitializeOnLoad]
class CompilationTimer : EditorWindow
{
static bool isTrackingTime;
@instance-id
instance-id / CompilationTimer.cs
Created August 11, 2019 23:47
Compilation Timer using Logwin.Log() asset
using System;
using UnityEngine;
using UnityEditor;
namespace instance.id.Editor
{
[InitializeOnLoad]
class CompilationTimer : EditorWindow
{
static bool isTrackingTime;
@instance-id
instance-id / DarkTheme.cs
Last active July 5, 2020 08:20
Legit/Legal Unity 2019.3.0bx beta dark theme one click converter
// --- instance.id ------------------------------------------------------------
// Thanks to TheZombieKiller and Peter77 for creating this
// https://forum.unity.com/threads/editor-skinning-thread.711059/#post-4785434
// Tested on Unity 2019.3.0b1 - 95% Dark mode Conversion
// Example Screenshot - https://i.imgur.com/9q5VPQk.png
// (Note - Once I ran this, I had to hit play and then it took effect)
// ----------------------------------------------------------------------------
using System;
using System.Text.RegularExpressions;
@instance-id
instance-id / EditorCameraZoomWithScrollWheel.cs
Created May 3, 2020 21:32
Fixes Unity editor viewport mousewheel
#if UNITY_2019_1_OR_NEWER
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public class EditorCameraZoomWithScrollWheel
{
private const float CAMERA_SPEED = -0.25f;
private static bool rmbDown = false;
import 'dart:io';
import 'package:firedart/firedart.dart';
import 'package:hive/hive.dart';
/// Stores tokens using a Hive store.
/// Depends on the Hive plugin: https://pub.dev/packages/hive
class HiveStore extends TokenStore {
static const keyToken = "auth_token";
@instance-id
instance-id / extensions.dart
Created June 3, 2020 03:39
Extending User class with additional fields. I don't know if this is the proper way to do it, though?
import 'package:firedart/auth/user_gateway.dart';
class FBUserData{
String _fname;
String _lname;
String _serialNum;
String _contactEmail;
String _verified;
}