Skip to content

Instantly share code, notes, and snippets.

View daniel-packard's full-sized avatar
🦊
Focusing, like a fox

Daniel Packard daniel-packard

🦊
Focusing, like a fox
View GitHub Profile
import './style.css'
import * as THREE from 'three'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
import { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js'
import { STLExporter } from 'three/examples/jsm/exporters/STLExporter.js'
import { OBJExporter } from 'three/examples/jsm/exporters/OBJExporter.js'
import { SimplifyModifier } from 'three/examples/jsm/modifiers/SimplifyModifier.js'
import * as dat from 'lil-gui'
//V1.2.0
default: target1
# no commands
target1: target2
@echo "Running target 1"
target2: target3
@echo "Running target 2"
target3:
default: target1 target2 target3
# no commands
target1:
@echo "Running target 1"
target2:
@echo "Running target 2"
target3:

install xming

  1. download the installer available here:

  2. Run the installer, the default options are fine

    • (you might want to create shortcuts on the desktop for Xming and XLaunch)
  3. Launch Xming

    • on your first launch, it will ask you which types of networks you want to allow... if you work in a lot of coffee shops, you should also include Public Networks (excluded by default)
// pseudo-ish code for the simple on/off state machine
// define all possible states
enum State {
ON,
OFF
};
// define all possible transitions (including NONE)
enum Transition {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace LambdaTest2
{
class Program
// compile with
// gcc pointers.c
#include <stdio.h>
typedef struct {
int x;
int y;
} point_t;
@daniel-packard
daniel-packard / AppControllerSnippet.cs
Created March 23, 2016 00:07
Should the HttpPost Contact method look like this instead?
[HttpPost]
public IActionResult Contact(ContactViewModel model)
{
var email = Startup.Configuration["AppSettings:SiteEmailAddress"];
if (string.IsNullOrWhiteSpace(email))
{
ModelState.AddModelError("", "Unable to send message: invalid server configuration.");
}
@daniel-packard
daniel-packard / StructPadding.c
Last active March 18, 2016 19:52
Demo on how to provide a padded wrapper for a struct to ensure it takes up 64Bytes, even as members are added/removed
#include <stdio.h>
typedef struct {
int a;
int b;
char c;
} unpadded_t;
typedef struct {
unpadded_t data;
@daniel-packard
daniel-packard / StructAssignment.c
Last active March 18, 2016 20:01
Demos some basic properties of struct assignments.
#include <stdio.h>
typedef struct {
int x;
int y;
} point_t;
void printPoint(point_t p) {
printf("X: %d, Y: %d\n", p.x, p.y);
}