Skip to content

Instantly share code, notes, and snippets.

View Abby3017's full-sized avatar

abhinav kumar Abby3017

View GitHub Profile
class Payload {
int idx;
ByteBuffer[] buf;
long value;
byte bits_left;
}
class Block {
DataSetHeader data_set_header;
BlockHeader block_header;
@Abby3017
Abby3017 / disable_spectre.md
Created April 11, 2020 03:19 — forked from rizalp/disable_spectre.md
Disable Spectre/Meltdown Mitigation

In /etc/default/grub, modify:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off"

Then sudo update-grub

@Abby3017
Abby3017 / SegmentTree.java
Created December 29, 2019 06:04
Segment Tree implementation that tell if given part of array is sorted or not
class SegmentTreeOrder {
class Node {
int value;
boolean isSorted;
Node() {};
Node(int v, boolean i) {
@Abby3017
Abby3017 / gist:3a8310c4a2023e4b020f67ddbe05aab5
Created June 20, 2018 08:09 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@Abby3017
Abby3017 / FileManager.java
Last active April 23, 2020 12:17
In React Native directory move is not provided, react-native-fs and react-native-fetch-blob fail to provide any interface for that. This is native way to do that
package com.abhinav;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.abhinav.FileModule;
import java.util.ArrayList;
import java.util.Collections;
package auth
import (
"context"
"net/http"
"strings"
"google.golang.org/grpc/metadata"
"github.com/andela/micro-api-gateway/pb/authorization"