Skip to content

Instantly share code, notes, and snippets.

View hellos3b's full-sized avatar

Sebastian hellos3b

  • Cisco
  • San Jose, CA
View GitHub Profile
@hellos3b
hellos3b / Photo.ts
Last active March 8, 2022 00:35
GraphQL + TypeORM example
/** models/photos/Photo.ts */
import {getRepository, Entity, In, Column, RelationCount, PrimaryGeneratedColumn, ManyToOne, CreateDateColumn, RelationId, OneToMany} from "typeorm";
import { User, Bird, Like } from '@/models'
@Entity()
export class Photo {
@PrimaryGeneratedColumn()
id: number;
/**
* @typedef {import('@/ship/systems/Systems').System} System
*/
import { StatsType } from '@/ship/Stats'
/** @type {System} */
export const BasicShield = {
name: "Basic Shield",
id : "basic-shield",
for (var i = 0; i < nodeCount; i++) {
let rng = Math.random()
let rx = Math.random()*width
let ry = Math.random()*height
let node = new Node({ id: i, x: rx, y: ry})
while (!isValidDistance(nodeList, node) || simplexPoint(rx, ry) > rng) {
rx = Math.random()*width
const validDistance = node => !nodeList.find(n => distance(n, node) < 40)
for (var i = 0; i < nodes; i++) {
let rx = Math.random()*width
let ry = Math.random()*height
let node = new Node({ id: i, x: rx, y: ry})
while (!validDistance(node)) {
rx = Math.random()*width
ry = Math.random()*height
@hellos3b
hellos3b / PrivacyPolicy.md
Last active August 16, 2019 19:48
Jot! Notes Widget Privacy Policy

Privacy Policy

Jot! Notes Widget by hellos3b

hellos3b built the Jot! Notes Widget app as a Free app. This SERVICE is provided by hellos3b at no cost and is intended for use as is.

No data that you enter into Jot! Notes Widget is shared anywhere. The notes you enter into the app are only ever stored on your device

We do not use any third party software to collect data on usage. We do collect anonymous crash reports from Google as is provided by the Play Store Service.

var Helpers = {
/* Schema keys are defined as either
key: Type
or
key: { type: Type }
This helper just converts the shorthand version to key: {type: Type}
and converts the Type to a string
*/
schema_parse(obj) {
public class Creature {
public string Name { get; set; }
public int Level { get; set; }
public GearItem[] Gear { get; set; }
public CreatureType Type { get; set; }
public string GUID { get; set; }
public Color color { get; set; }
// Stats
public Stat STR;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
public class PlayerAnimationController : NetworkBehaviour {
private PlayerActionController playerController;
private PlayerMovementController playerMovement;
@hellos3b
hellos3b / PlayerSyncTransform.cs
Last active February 1, 2020 00:14
Custom network smoothing using uNet in Unity3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using ThirdPersonCamera;
/// <summary>
/// Sync and Smooth out player's movement
/// </summary>
public class PlayerSyncTransform : NetworkBehaviour {
void FixedUpdate () {
if (input2.y < 0) {
InputDirection.y = Mathf.Clamp( InputDirection.y - pullSpeed * Time.fixedDeltaTime, -1f, 1f);
} else if (input2.y > 0) {
InputDirection.y = Mathf.Clamp( InputDirection.y + pullSpeed * Time.fixedDeltaTime, -1f, 1f);
} else {
InputDirection.y = InputDirection.y - (InputDirection.y * pullSpeed * Time.fixedDeltaTime);
if (Mathf.Abs(InputDirection.y) < 0.025f) {
InputDirection.y = 0;
}