Skip to content

Instantly share code, notes, and snippets.

View saltire's full-sized avatar
👾
hackin'

saltire saltire

👾
hackin'
View GitHub Profile
@antonkudin
antonkudin / logoAssembler.cs
Last active May 2, 2019 10:34
MegaSphere logo assembler
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class logoAssembler : MonoBehaviour {
[SerializeField] bool debugMe;
[SerializeField] bool remakePixels;
[SerializeField] bool autoPlay;
[SerializeField][Range(0,10)] float autoDur = 10;
#include <stdio.h>
#include <stdlib.h>
const int H = 40;
const int W = 80;
char map[H][W];
int rnd(int max) {
return rand() % max;
@munificent
munificent / generate.c
Last active May 1, 2024 20:06
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@danwhitston
danwhitston / wsl_first_time_setup.sh
Last active May 7, 2022 13:34
Setting up my WSL environment - includes git & key, rbenv, rbenv ruby-build, attis, imagemagick, ruby, bundler, mysql, mongodb, redis
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
ln -s "/mnt/c/Users/Daniel/Documents/homeflow" ~/homeflow
ln -s "/mnt/c/Users/Daniel/Documents" ~/documents
mkdir .ssh
cp documents/id* .ssh/
sudo chmod 600 .ssh/*
cd homeflow/attis
git pull
// c# companion script
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- //
// Save you your project, add to your SpriteRenderer gameObject
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[ExecuteInEditMode]
@dentechy
dentechy / WSL-ssh-server.md
Last active March 30, 2024 16:16
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: