Skip to content

Instantly share code, notes, and snippets.

View nmabhinandan's full-sized avatar
🏠
Working from home

Abhinandan nmabhinandan

🏠
Working from home
View GitHub Profile
@nmabhinandan
nmabhinandan / dgraph-cli.ps1
Created April 8, 2021 18:45
powershell script to start and stop dgraph database
if($args[0] -eq "start") {
Start-Process -FilePath dgraph.exe -PassThru -WindowStyle hidden -ArgumentList "alpha", "--lru_mb 1024" -WorkingDirectory .
Start-Process -FilePath dgraph.exe -PassThru -WindowStyle hidden -ArgumentList "zero" -WorkingDirectory .
Start-Process -FilePath dgraph-ratel.exe -PassThru -WindowStyle hidden -WorkingDirectory .
} elseif($args[0] -eq "stop") {
Stop-Process -Name dgraph -Force
Stop-Process -Name dgraph-ratel -Force
}
@nmabhinandan
nmabhinandan / createSearchIndex.js
Created March 6, 2020 06:15
lunr search index builder
function createSearchIndex(tags, data) {
if (schema === null || !Array.isArray(tags)) {
return false;
}
if (data === null || !Array.isArray(data)) {
return false;
}
let searchIndex = lunr(function () {
this.ref('id')

Keybase proof

I hereby claim:

  • I am nmabhinandan on github.
  • I am nmabhinandan (https://keybase.io/nmabhinandan) on keybase.
  • I have a public key whose fingerprint is D3EC F976 C2EC E8EE BC1E 6949 6269 798F 5377 A3BB

To claim this, I am signing this object:

@nmabhinandan
nmabhinandan / clion64.vmoptions
Created October 11, 2017 00:16
Intellij IDE VM options
-server
-Xms4g
-Xmx4g
-XX:NewRatio=3
-Xss16m
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
-XX:+UseCompressedOops
@nmabhinandan
nmabhinandan / main.c
Created January 13, 2017 10:45
Implementation of Intersection and Union of integer digits in C
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
bool anyMatch(int32_t num1, int32_t num2) {
while(true) {
if ((num2 % 10) == num1) {
return true;
}
@nmabhinandan
nmabhinandan / main.c
Last active January 13, 2017 10:44
Integer array implementation in C
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef struct __array__
{
int* data;
int capacity;
int size;
int max;

Keybase proof

I hereby claim:

  • I am nmabhinandan on github.
  • I am nmabhinandan (https://keybase.io/nmabhinandan) on keybase.
  • I have a public key whose fingerprint is 1473 109C EFCF 4FB2 5301 5AFD 1F44 8457 24C8 583F

To claim this, I am signing this object:

@nmabhinandan
nmabhinandan / init.coffee
Created September 18, 2015 10:54
Godep save command for atom text editor. (~/.atom/init.coffee)
atom.commands.add 'atom-text-editor', 'godep:save', =>
sys = require('sys')
exec = require('child_process').exec
godep_save_cmd = "godep save -r"
child = exec godep_save_cmd, (error, stdout, stderr) ->
console.log('\ngodep stdout: ' + stdout);
console.log ('\ngodep stderr: ' + stderr);
if error
@nmabhinandan
nmabhinandan / gulpfile.js
Last active March 19, 2017 18:49
Express Nodemon BrowserSync Gulp
var gulp = require('gulp');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var sourcemaps = require("gulp-sourcemaps");
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');
var nodemon = require('gulp-nodemon');
var path = require('path');
@nmabhinandan
nmabhinandan / .travis.yml
Last active April 28, 2017 15:45
Testing ES6 using Mocha by transpiling (using babel) into AMD(RequireJS) on PhantomJS.
language: node_js
node_js:
- '0.10'
- '0.11'
- '0.12'
- 'iojs-v1.7.1'
matrix:
allow_failures: