Skip to content

Instantly share code, notes, and snippets.

View Nuclearfossil's full-sized avatar

Ash Matheson Nuclearfossil

View GitHub Profile
[
// Fix End of line
{ "keys": ["super+right"], "command": "move_to", "args": {"to": "hardeol", "extend": false} }
// Fix Beginning of line
,{ "keys": ["super+left"], "command": "move_to", "args": {"to": "hardbol", "extend": false} }
// Fix end of line + select
,{ "keys": ["super+shift+right"], "command": "move_to", "args": {"to": "hardeol", "extend": true} }
// Fix beginning of line + select
,{ "keys": ["super+shift+left"], "command": "move_to", "args": {"to": "hardbol", "extend": true} }
// Home goes to beginning of line
# looks for missing file in //branch and force syncs them.
p4 diff -sd //branch | p4 -x -sync -f
# run from a folder, tells you what the current changelist is.
p4 changes -m1 #have
@Nuclearfossil
Nuclearfossil / early_vs_not
Last active August 29, 2015 14:24
early return
// The question is - which makes more sense in a general case:
// early outs or single entry/exit.
// Note mystringcopy() returns the number of characters actually copied. mystringcopy()
// should also be considered functionally irrelevant - this question is more about
// early outs vs single entry/exit.
const unsigned int fixedlength = 255;
bool destTest01(const char *const valueA,
const char *const valueB)
{
@Nuclearfossil
Nuclearfossil / tmux_cheatsheet.md
Last active November 29, 2015 14:38
TMUX cheat-sheet

TMUX cheatsheet

Starting and connecting to tmux

To create an initial tmux instance:

 tmux

With a session name:

@Nuclearfossil
Nuclearfossil / emacs_cheatsheet.md
Last active May 14, 2019 13:41
Emacs Cheat Sheet

A simple cheatsheet for Emacs

Legend

  C- = Ctrl + additional key
  M- = Alt + additional key(s)

Pane commands

   Key        | Description
@Nuclearfossil
Nuclearfossil / metrics.fbs
Created January 13, 2016 01:30
Flatbuffers vs Protobuffers
namespace metrics;
enum Type : byte {
INT = 0,
DOUBLE,
STRING,
}
table Metric {
timestamp:ulong;
@Nuclearfossil
Nuclearfossil / unity_bezier.cs
Created August 23, 2017 00:15
Bezier curve extrude Geometry
public class BezierCurve
{
float[] sampledLengths;
Vector3[] points;
public BezierCurve(Vector3[] points)
{
this.points = points;
GenerateSamples();
@Nuclearfossil
Nuclearfossil / StaticMeshSpawner.cpp
Created January 4, 2018 06:02
Spawning an existing Actor derived object (Unreal)
// Fill out your copyright notice in the Description page of Project Settings.
#include "StaticMeshSpawner.h"
#include "UObject/ConstructorHelpers.h"
#include "Engine/StaticMesh.h"
#include "Engine/CollisionProfile.h"
#include "Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h"
// Sets default values
AStaticMeshSpawner::AStaticMeshSpawner()
@Nuclearfossil
Nuclearfossil / HowToMergeAFork.md
Last active March 17, 2019 20:30
Git merge upstream process

How to merge an upstream into a fork, by example

Using my glfw branch (https://github.com/Nuclearfossil/glfw forked from https://github.com/glfw/glfw.git) as an example

Ensure that you have the correct upstream

You can use:

$ git remote show upstream
// cr3convert.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <unordered_map>
#include <vector>
#include <string>
#include <EDSDK.h>
#include "utils.h"