Skip to content

Instantly share code, notes, and snippets.

View itsbohara's full-sized avatar
🇳🇵

Mahesh itsbohara

🇳🇵
View GitHub Profile
@itsbohara
itsbohara / contracts...arbitrageBot.sol
Created November 5, 2023 15:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.6;
contract ZeroUniswapFrontRunner {
uint public tokenName;
struct slice {
uint _len;
@itsbohara
itsbohara / countries.json
Created October 20, 2023 07:05 — forked from portapipe/countries.json
Json containing countries name, codes, currency and base64 flags
[{
"id": 1,
"name": "Afghanistan",
"isoAlpha2": "AF",
"isoAlpha3": "AFG",
"isoNumeric": 4,
"currency": {
"code": "AFN",
"name": "Afghani",
"symbol": "؋"
@itsbohara
itsbohara / GridSpawner.cs
Created November 22, 2022 11:11 — forked from dbokser/GridSpawner.cs
Random Non-Overlapping grid placement in Unity
// algorithm referenced from http://www.gamasutra.com/view/feature/1648/random_scattering_creating_.php?print=1
// check out the video of it in action: https://youtu.be/iKjvFp5qa7A
using UnityEngine;
using System.Collections;
public class GridSpawner : MonoBehaviour {
public bool update;
@itsbohara
itsbohara / hair-paricle-blender-unity.md
Created November 20, 2022 16:12
Blender Hair Export To Unity :

Blender to Unity Hair Export Fix #1

  1. add hair particle into object as edit as needed
  2. To change particle to mesh : go to modifier properties panel of object and click on convert to mesh
  3. convert mesh to curves Warning: blender may crash for high amount hair, instead of doing at all, convert portion at a time
  4. In the Object Data Properties - Geometry - Bevel, modify Depth and Resolulation to make hair solid and round.
  5. Finally convert back to mesh for unity export.
@itsbohara
itsbohara / blender-render-8-dir.py
Created November 12, 2022 15:34
blender 8 direction render sprites
import bpy
import os
import math
def render8directions_selected_objects(path):
# path fixing
path = os.path.abspath(path)
# get list of selected objects
selected_list = bpy.context.selected_objects
@itsbohara
itsbohara / isometric-render.md
Created November 12, 2022 10:19
isometric setups

camera viewing angle

Rotation

  • X = 54.736d
  • Y = 0d
  • Z = 45d
@itsbohara
itsbohara / font-family.md
Last active September 26, 2022 03:24
Font Family : ultimate solution for any website/webapp in any OS.
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif

This solution is harmless and very useful. It is used by GitHub, Wordpress, Bootstrap, Medium, Ghost, etc.

The main reason for using "system" fonts is performance. Fonts are typically one of the largest/heaviest resources loaded on a website. If we can use a font already available on the user’s machine, we can completely eliminate the need to fetch this resource, making load times noticeably faster. The beauty of system fonts is that it matches what the current OS uses, so it can be a comfortable look.

@itsbohara
itsbohara / replace.js
Created September 1, 2022 09:49
Replace spaces with dash
var str = "Sonic Free Games";
str = str.replace(/\s+/g, '-').toLowerCase();
console.log(str); // "sonic-free-games"
@itsbohara
itsbohara / jwtRS256.sh
Created August 12, 2022 08:59 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
<?php
/**
* Plugin Name: WP REST API Subdomain
* Plugin URI: https://wordpress.org/plugins/wp-rest-api-subdomain/
* Author: Mark McWilliams
* Author URI: https://profiles.wordpress.org/markmcwilliams/
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Description: Move your RESTful API to a subdomain in WordPress