Skip to content

Instantly share code, notes, and snippets.

View jdnichollsc's full-sized avatar
🏠
Working from home

J.D Nicholls jdnichollsc

🏠
Working from home
View GitHub Profile
@lopspower
lopspower / 1-README.md
Last active January 19, 2023 09:25
EventBus Introduction

EventBus Introduction

API

General usage and API

Here we pick up on the 3 steps of the README and expand a bit on the code.

1: Define events

Events are POJO (plain old Java object) without any specific requirements.

@selalipop
selalipop / GameState.cs
Last active September 9, 2022 20:29
Using Server-Sent-Events in Unity
using Newtonsoft.Json;
///Use of Newtonsoft.Json is fully optional
namespace Backend
{
[JsonObject]
public struct GameState
{
[JsonProperty("maxPlayers")] public int MaxPlayers;
[JsonProperty("imposterCount")] public int ImposterCount;
@Angelfire
Angelfire / splitList.js
Created August 25, 2022 02:11
Split a list into X chunks
function splitList(list, chunkSize) {
const groupSize = Math.ceil(list.length / chunkSize)
let chunked = []
for (let i = 0; i < list.length; i += groupSize) {
chunked.push(list.slice(i, i + groupSize))
}
return chunked
}
@wassname
wassname / permutations.js
Last active June 28, 2022 22:53
Combinatorics permutatons and product in javascript using lodash.js (like python's itertools)
/**
* Lodash mixins for combinatorics
* by: wassname & visangela
* url: https://gist.github.com/wassname/a882ac3981c8e18d2556/edit
* lodash contrib issue: https://github.com/node4good/lodash-contrib/issues/47
* lic: same as lodash
* Inspired by python itertools: https://docs.python.org/2.7/library/itertools.html
*
* Usage:
* permutations([0,1,2],2) // [[0,1],[0,2],[1,0],[1,2],[2,0],[2,1]]
@lisp-is-the-future
lisp-is-the-future / install-termux-arch.md
Last active May 20, 2022 10:30
How to install TermuxArch in Termux of Android (Samsung Galaxy Tab 10.1)
#################################################################
# How to install Arch in your Android (into the App TermuxArch)
# and be able to use your Android device like a personal computer
# even running a X server to have GUI
#################################################################


###############################
# Install Termux

Estamos usando Pins para compartir, guardar y tener una forma fácil de encontrar ofertas de trabajo

Compartiendo ofertas de trabajo

  1. Comparta la oferta de trabajo idealmente incluyendo descripción, habilidades requeridas, habilidades deseadas, salario, si es remota o no y cómo aplicar a la oferta.

Por ejemplo:

Desarrollador Full Stack en Medellín.
@sphingu
sphingu / MVC_InterView_Questions.md
Created June 19, 2013 09:18
MVC Interview Questions

Interview Question


1.In which assembly is the MVC framework defined? System.Web.Mvc

2.What is ViewData, ViewBag and TempData?

  MVC offers Three options for passing data from controller to View and  in next request. 
ViewData & ViewBag are almost similar.
  	Short life means value becomes null when redirection occurs.
		It’s a communication mechanism within the server call.
Difference between ViewBag & ViewData:
/*
* Write a function:
*
* function solution(A);
*
* that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
*
* For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
*
* Given A = [1, 2, 3], the function should return 4.
@dlucidone
dlucidone / Nativescript String to Base64 String and Vice-Versa.ts
Last active January 31, 2021 00:53
Nativescript Base64 Manipulation Methods
/*
* Convert A String to Base64 String or Vice-Versa
*/
declare const android: any;
declare const java: any;
declare const NSData: any;
declare const NSUTF8StringEncoding: any;
declare const NSString: any;
@kenbellows
kenbellows / log-binary-tree.js
Created April 17, 2017 21:04
Log a binary tree data structure to the console
/**
* Recursively print a binary tree data structure
* @param {function} printFn function used to print output; called with a single string argument
* @param {object} node current node object
* @param {string|function} leftKey name of current node's left child property, or a function that accepts the
* current node and returns the left child node
* @param {string|function} rightKey name of current node's right child property, or a function that accepts the
* current node and returns the right child node
* @param {string|function} displayKey property to display, or a function that returns a display string
* @param {string} [indent=''] current indentation string; mostly used to build up indentation across levels