Skip to content

Instantly share code, notes, and snippets.

View steelx's full-sized avatar
🎮
GameDev by night

Ajinkya Borade steelx

🎮
GameDev by night
View GitHub Profile
@steelx
steelx / go.md
Last active November 14, 2019 14:34
Add version to GO package

Tag your git repository with a version number (ideally based on the semantic versioning specification e.g. v0.0.0).

git tag -a v0.0.0 -m "First tag." Push the version number to the remote repository.

git push --tags Generate an up-to-date version_PLATFORM.go file (normally done by your CI server)

go generate The version_PLATFORM.go file gets automatically updated with data from the tag.

#Headless Setup of Raspberry Pi Zero W (Raspberry Pi 3 Wireless) (macOS)

  1. Formatt the Micro SD card - Open a terminal and type 'diskutil list'. Find your card and copy the disk name (For example: /dev/disk4). Format the card with diskutil eraseDisk ExFat temp disk4(Use your disk here)
  2. Download Raspbian - wget https://downloads.raspberrypi.org/raspbian_lite_latest
  3. Unmount the SD card - diskutil unmountDisk /dev/disk4 or whatever your disk path is
  4. Mount the Raspbian image to the card - sudo dd if=PATH-TO-RASPBIAN-IMAGE of=/dev/disk4` or whatever your disk path is
  5. Enable SSH on the Pi - cd /volumes && ls. You should see a boot partition from the SD card cd boot && touch ssh
  6. Setup WiFi on the PI - While still in the boot partition of the card type nano wpa_supplicant.conf and enter network={ ssid="YOUR-SSID" psk="YOUR-WIFI-PASSWORD" }
  7. Boot the PI - Unmount the card diskutil unmountDisk /dev/disk4 (or whatever your disk path is) and put it in the
@steelx
steelx / bounds.go
Created December 25, 2019 18:56
Go inheritance with Interface (Entity) + pixelgl
package main
// Bounds - A bounding (rectangle) box with a x,y origin and width and height
type Bounds struct {
X float64
Y float64
Width float64
Height float64
entity Entity
}
@steelx
steelx / go.mod
Created June 17, 2020 03:57
GoLang RPG game modules
module github.com/steelx/go-rpg-cgm
go 1.13
require (
//github.com/bcvery1/tilepix v0.3.2
github.com/bykof/stateful v0.0.7 // indirect
github.com/faiface/beep v1.0.2
github.com/faiface/pixel v0.8.1-0.20190416082708-9aca3bfe7af3
github.com/fatih/structs v1.1.0
@steelx
steelx / server.js
Created July 28, 2020 11:43
Node js AUTH middleware
const express = require('express');
const cors = require('cors')({origin: true});
const cookieParser = require('cookie-parser')();
// API
const app = express();
// Express middleware that validates Firebase ID Tokens passed in the Authorization HTTP header.
@steelx
steelx / backup bash filez
Last active August 17, 2020 14:58 — forked from azappa/backup bash filez
Ubuntu fix dual monitor reboot
#!/bin/bash
# -------------------------------------------------
# Get monitors configuration from monitor.xml and apply it for current user session.
# In case of multiple definitions in monitor.xml only first one is used.
#
# See http://bernaerts.dyndns.org/linux/74-ubuntu/309-ubuntu-dual-display-monitor-position-lost
# for instructions
#
# Revision history :
# 19/04/2014, V1.0 - Creation by N. Bernaerts
@steelx
steelx / introrx.md
Created August 26, 2020 13:10 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@steelx
steelx / keybase.md
Last active September 16, 2020 14:35

Keybase proof

I hereby claim:

  • I am steelx on github.
  • I am ajinkyax (https://keybase.io/ajinkyax) on keybase.
  • I have a public key ASBcCAmHxUEdhdbob_x7y20mMu6wkd8AphMHNXhVCQzXQwo

To claim this, I am signing this object:

@steelx
steelx / api-deploy.yml
Created September 25, 2020 05:11
Rust :: Build and Deploy to GCP
name: Build and Deploy to Google
on:
workflow_dispatch:
# Environment variables available to all jobs and steps in this workflow
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GITHUB_SHA: ${{ github.sha }}
RUN_REGION: asia-southeast1
@steelx
steelx / esp32_ota_stm32.ino
Created November 6, 2020 12:56 — forked from rounakdatta/esp32_ota_stm32.ino
Flash STM32 firmware from ESP32
#include <SPIFFS.h>
/*
*
* Copyright (C) 2017 CS.NOL https://github.com/csnol/1CHIP-Programmers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* and You have to keep below webserver code