Skip to content

Instantly share code, notes, and snippets.

View AnweshGangula's full-sized avatar

Anwesh Gangula AnweshGangula

View GitHub Profile
@AnweshGangula
AnweshGangula / git-pushing-multiple.rst
Created January 11, 2022 18:35 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

library(rayshader)
library(rayrender)
popdata = raster::raster("gpw_v4_population_density_rev11_2020_15_min.tif")
population_mat = rayshader:::flipud(raster_to_matrix(popdata))
above1 = population_mat > 1
above5 = population_mat > 5
above10 = population_mat > 10
@AnweshGangula
AnweshGangula / README.md
Created September 27, 2022 09:47 — forked from magnetikonline/README.md
Extract all files at every commit of a Git repository.

Extract all files at every commit of a Git repository

Bash script to iterate all commits of a given Git repository and extract all files within each commit.

Example

With a Git repository at /path/to/repository and an empty directory at /path/to/output we can run:

./export.sh /path/to/repository /path/to/output
@AnweshGangula
AnweshGangula / vec3-mat4.py
Created November 18, 2022 12:48 — forked from nkint/vec3-mat4.py
numpy - vec3 transformation mat4
import numpy as np
def cube_geometry(x, y, z):
xSize = x / 2
ySize = y / 2
zSize = z / 2
positions = np.array([
[-xSize, ySize, zSize], [xSize, ySize, zSize],
[-xSize, -ySize, zSize], [xSize, -ySize, zSize],
@AnweshGangula
AnweshGangula / index.html
Created June 9, 2023 12:45 — forked from nickjevershed/index.html
Simple rain-like animation in d3, rendered in svg rather than canvas.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#graphicContainer {
width: 400px;
background:#F2F2F2;
@AnweshGangula
AnweshGangula / camera.tsx
Created June 16, 2023 09:00 — forked from nickyvanurk/camera.tsx
Camera perspective <-> orthographic toggle in r3f and vanilla three.js
import { useEffect, useRef, useState } from 'react';
import { useFrame, useThree } from '@react-three/fiber';
import { MapControls, OrthographicCamera, PerspectiveCamera } from '@react-three/drei';
import type { OrbitControls as OrbitControlsImpl } from 'three-stdlib';
export function Camera() {
const [oldType, setOldType] = useState('PerspectiveCamera');
const [coords, setCoords] = useState({ x: 0, y: 0 });
const gl = useThree((state) => state.gl);
@AnweshGangula
AnweshGangula / .block
Last active June 17, 2023 08:44 — forked from mbostock/.block
Closest Point on SVG Path
license: gpl-3.0
@AnweshGangula
AnweshGangula / BetterOrbitControls.js
Created September 6, 2023 12:13 — forked from XanderLuciano/BetterOrbitControls.js
Improved three.js orbit controls with improved support for mobile devices, improved smoothing, and a few other features. Will have to merge in additional changes (like setAzimuthalAngle, setPolarAngle, and setRotation).
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
*/
// This set of controls performs orbiting, dollying (zooming), and panning.
// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
@AnweshGangula
AnweshGangula / keepSysAwake.ps1
Created December 13, 2023 10:56 — forked from selvalogesh/keepSysAwake.ps1
A system tray app for windows using Power shell script to keep your system awake.
#Thanks to - https://github.com/damienvanrobaeys/Build-PS1-Systray-Tool
# - https://www.systanddeploy.com/2018/12/create-your-own-powershell.html
# - https://stackoverflow.com/questions/54649456/powershell-notifyicon-context-menu
# - https://adamtheautomator.com/powershell-async/
[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | out-null
[System.Reflection.Assembly]::LoadWithPartialName('presentationframework') | out-null

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple: