Skip to content

Instantly share code, notes, and snippets.

View igolden's full-sized avatar
🎯
Focusing

Ian Golden igolden

🎯
Focusing
View GitHub Profile
@igolden
igolden / gist:59080958199ffd8909fb77e5fd46ba89
Created September 3, 2017 07:22
Vim theming help for reference
ColorColumn used for the columns set with 'colorcolumn'
*hl-Conceal*
Conceal placeholder characters substituted for concealed
text (see 'conceallevel')
*hl-Cursor*
Cursor the character under the cursor
*hl-CursorIM*
CursorIM like Cursor, but used when in IME mode |CursorIM|
*hl-CursorColumn*
CursorColumn the screen column that the cursor is in when 'cursorcolumn' is
@igolden
igolden / gist:26f90fa18a7f613ab7c97ea82f5ec41e
Created September 3, 2017 07:22
Vim theming help for reference
ColorColumn used for the columns set with 'colorcolumn'
*hl-Conceal*
Conceal placeholder characters substituted for concealed
text (see 'conceallevel')
*hl-Cursor*
Cursor the character under the cursor
*hl-CursorIM*
CursorIM like Cursor, but used when in IME mode |CursorIM|
*hl-CursorColumn*
CursorColumn the screen column that the cursor is in when 'cursorcolumn' is
@igolden
igolden / addnewuser.sh
Last active September 7, 2017 21:57
Adds a new user
#!/bin/bash
set -e
echo "This tool will create a new sudo user."
echo "================================================"
echo ""
echo "Choose username:"
read NEWUSER
echo "Choose password:"
@igolden
igolden / install_shellinabox.sh
Last active September 7, 2017 22:34
Install shell in a box on ubuntu
#!/bin/bash
apt-get update && apt-get upgrade -y
apt-get install -y vim git ruby ruby-dev nodejs build-essential \
git libssl-dev libpam0g-dev zlib1g-dev \
dh-autoreconf
git clone https://github.com/shellinabox/shellinabox.git
cd shellinabox
autoreconf -i
@igolden
igolden / install_tmate.sh
Created September 7, 2017 23:23
Install tmate on ubuntu
#!/bin/bash
apt-get update && apt-get upgrade -y
apt-get install git-core build-essential \
pkg-config libtool libevent-dev \
libncurses-dev zlib1g-dev \
automake libssh-dev cmake \
ruby
# clone repo, change WORKDIR
@igolden
igolden / MovementController.cs
Created October 16, 2017 23:24
Simple character movement in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BoxController : MonoBehaviour {
public float speed = 10.0F;
public float rotationSpeed = 100.0F;
void Update()
{
@igolden
igolden / Timer.cs
Created October 17, 2017 00:12
Timer for unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Timer : MonoBehaviour {
public Text timerLabel;
private float time;
@igolden
igolden / gist:9565e53df1ac91c114f67a6e2b5ecce3
Created October 18, 2017 05:39
Main Camera toggle in Unity C# - toggles between two camera transforms
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraHandler : MonoBehaviour {
// Represents the main camera
GameObject mainCamera;
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Space))
@igolden
igolden / gist:1f38552ae2f4f4f81c6a77e4d8a3f2b3
Created October 18, 2017 05:45
Rotate object in Unity 3d
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public float smooth = 2.0F;
public float tiltAngle = 30.0F;
void Update() {
float tiltAroundZ = Input.GetAxis("Horizontal") * tiltAngle;
float tiltAroundX = Input.GetAxis("Vertical") * tiltAngle;
Quaternion target = Quaternion.Euler(tiltAroundX, 0, tiltAroundZ);
@igolden
igolden / drag.cs
Created October 18, 2017 06:52
Control drag on a rigid body (unity script)
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Rigidbody rb;
void Start() {
rb = GetComponent<Rigidbody>();
}
void OpenParachute() {
rb.drag = 20;