Skip to content

Instantly share code, notes, and snippets.

View sepsol's full-sized avatar
:electron:
Hyperstate

Sepehr Soltanieh sepsol

:electron:
Hyperstate
View GitHub Profile
@pratyakshm
pratyakshm / Sideloading_apps_in_WSA.md
Last active May 10, 2024 13:22
Sideloading apps on Windows Subsystem for Android in Windows 11

Sideloading APKs in to Windows Subsystem for Android

Update (9th July, 2022): An app is available that does just this.

Check out WSATools by Simone Franco: https://www.microsoft.com/store/apps/9N4P75DXL6FG


Setting up ADB to work with WSA

  • Launch Windows Subsystem for Android.
@kuroski
kuroski / camelCase-snake_case-types.ts
Last active December 2, 2024 09:55
Typescript type camelCase / snake_case conversion
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}`
? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}`
: Lowercase<S>
type KeysToCamelCase<T> = {
[K in keyof T as CamelCase<string & K>]: T[K]
}
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ?
@piouson
piouson / setup-android-sdk.sh
Last active September 19, 2024 17:17 — forked from jjvillavicencio/setup.sh
Install Android SDK on Windows Bash (WSL)
cd ~
sudo apt-get install unzip zip
# see https://developer.android.com/studio#command-tools for latest commandline-tools
wget https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
unzip commandlinetools-linux-6858069_latest.zip -d Android
rm commandlinetools-linux-6858069_latest.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk # or install openjdk-11-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
@piouson
piouson / react-native-app-in-wsl2.md
Last active August 15, 2024 16:31 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2
@vivekhaldar
vivekhaldar / cut_silence.py
Last active September 8, 2024 13:51
Python script to cut out silent parts from a video. Uses moviepy.
#!/usr/bin/env python
#
# Based on a script by Donald Feury
# https://gitlab.com/dak425/scripts/-/blob/master/trim_silenceV2
# https://youtu.be/ak52RXKfDw8
import math
import sys
import subprocess
import os
@scottyhq
scottyhq / merge-conflict-rebase.md
Created August 10, 2020 18:25
GitHub PR Merge Conflict Resolution with Rebase

How to rebase a pull request to fix merge conflicts

It's quite common to open up a pull request on GitHub and be confronted with the message This branch has conflicts that must be resolved. This situation arises when you create a feature branch on an older commit from the master branch. Maybe you forgot to run git pull master before git checkout -b geocoding_vignette or maybe a collaborator changed some of the same files on GitHub while you've been working on new things. There are many ways to fix this. One is using the Web Editor build into GitHub and fixing conflicts by hand. This works great if there are not too many conflicts.

Another technique is to rebase your pull request onto the master branch (Move your additional commits on top of the most recent master commit). This is conceptually clean, but sometimes confusing in practice to do cleanly. This example walks through the process where you want to do a rebase, and resolve conflicts by overwriting whatever is on the master branch with change

@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active December 1, 2024 08:09
Building a react native app in WSL2
@mohamadaliakbari
mohamadaliakbari / ubuntu-run-dhclient-on-startup.md
Last active July 31, 2024 08:46
Run dhclient on Startup in Ubuntu 18.04

dhclient is the Dynamic Host Configuration Protocol (DHCP) Client one would use to allow a client to connect to a DHCP server.

$ sudo nano /etc/rc.local

#!/bin/bash
dhclient
exit 0
@simov
simov / README.md
Last active October 8, 2024 11:55
Run `node` scripts using `nvm` and `crontab` without hardcoding the node version

Run node scripts using nvm and crontab without hardcoding the node version

cronjob.env.sh

#!/bin/bash

# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function
@0xjac
0xjac / private_fork.md
Last active December 1, 2024 01:49
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git