Skip to content

Instantly share code, notes, and snippets.

View xyznaveen's full-sized avatar
🎯
Focusing

Naveen Niraula xyznaveen

🎯
Focusing
View GitHub Profile
@xyznaveen
xyznaveen / README.md
Created May 9, 2021 14:39 — forked from ccssmnn/README.md
Raspberry Pi 4 + Theia IDE = ❤️

Set up Theia IDE on Raspberry Pi 4

Requirements

Install node version 10 and yarn:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
nvm install 10
npm install -g yarn
@xyznaveen
xyznaveen / Count Code lines
Created December 31, 2020 06:45 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@xyznaveen
xyznaveen / visualstudio2019Key.txt
Created October 22, 2020 14:33
Visual Studio 2019 Product Key
Visual Studio 2019 Product Key
[Please Star this gist]
Follow My GitHub Account --> https://github.com/ch-kashif @ch-kashif
**Follow Me On Instagram -->> https://www.instagram.com/ch.kashif602/ **
Lets do a code together
Join Cloud Disk repository --> https://github.com/ch-kashif/CloudDisk
@xyznaveen
xyznaveen / geo.js
Created August 7, 2019 09:21 — forked from omurbekjk/generateRandomGeoLocations.ts
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@xyznaveen
xyznaveen / delete_git_submodule.md
Created June 8, 2019 04:43 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@xyznaveen
xyznaveen / AESGCMUpdateAAD2.java
Created March 18, 2019 06:31 — forked from praseodym/AESGCMUpdateAAD2.java
JDK8 AES-GCM code example
import javax.crypto.*;
import javax.crypto.spec.GCMParameterSpec;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import java.util.Arrays;
public class AESGCMUpdateAAD2 {
// AES-GCM parameters
public static final int AES_KEY_SIZE = 128; // in bits
@xyznaveen
xyznaveen / SearchBar.java
Created March 3, 2019 06:41 — forked from philipbjorge/SearchBar.java
Android Asynchronous ContentProvider - Search as you type
package edu.wwu.cs412.tvfanatic;
import edu.wwu.cs412.tvfanatic.account.AccountPreferenceActivity;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.app.SearchManager;
import android.app.FragmentManager.BackStackEntry;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@xyznaveen
xyznaveen / generate-pushid.js
Created July 18, 2018 09:17 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@xyznaveen
xyznaveen / git-deployment.md
Created May 16, 2018 07:37 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.