Skip to content

Instantly share code, notes, and snippets.

Avatar

Prabir Shrestha prabirshrestha

View GitHub Profile
@prabirshrestha
prabirshrestha / Makefile
Last active Mar 9, 2020
generic c makefile
View Makefile
# Final binary
BIN = $(shell basename $$(pwd))
ifeq ($(OS),Windows_NT)
EXE+=.exe
endif
# Default to build with multiple instances for speed
MAKEFLAGS =+ -j
# VERSION = 0.1
@prabirshrestha
prabirshrestha / log.log
Created Aug 9, 2017
performance - very slow compared to tsserver
View log.log
This file has been truncated, but you can view the full file.
DEBUG --> { method: 'initialize',
jsonrpc: '2.0',
id: 1,
params:
{ rootUri: 'file:///D:/tmp/flow-helloworld',
capabilities: {},
rootPath: 'file:///D:/tmp/flow-helloworld' } }
DEBUG <-- { jsonrpc: '2.0',
method: '$/partialResult',
View autoload_asyncomni.vim
" save all the completions
let s:completions = []
function! asyncomni#omnifunc(findstart, base)
if a:findstart
let l:line_string = getline('.')
let l:line = line('.')
let l:col = col('.')
" locate start of the word
let l:start = l:col -1
View aad outlook graph api.html
<!DOCTYPE html>
<html>
<head>
<title>AAD Login</title>
</head>
<body>
<button id="login-button">Login</button>
<!-- https://apps.dev.microsoft.com/#/appList
https://dev.outlook.com/AppRegistration
https://account.live.com/consent/Manage
@prabirshrestha
prabirshrestha / init.vim for dein.vim
Last active Dec 24, 2016
bootstrap vim plugin managers
View init.vim for dein.vim
" to use existing vim configuration as neovim configuration
" ln -s ~/.vimrc ~/.config/nvim/init.vim
let mapleader = ' '
" vimrc {{{
nnoremap <leader>ev :e $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" }}}
let s:settings = {}
@prabirshrestha
prabirshrestha / client.vim
Last active Oct 22, 2016
async vim with channel
View client.vim
function! s:Handler(handle, msg)
echom a:handle
echom a:msg
endfunction
let handle = ch_open('localhost:8000', {'mode': 'json'})
call ch_sendexpr(handle, 'hello', function('s:Handler'))
@prabirshrestha
prabirshrestha / termbox-sample.go
Last active Sep 14, 2015
termbox-go with (partial) react style rendering.
View termbox-sample.go
package main
import (
"time"
"github.com/nsf/termbox-go"
)
type appState struct {
endEventLoop bool
View actions.js
export function increment() {
return {
type: 'INCREMENT'
};
}
function decrement() {
return {
type: 'DECREMENT'
};
@prabirshrestha
prabirshrestha / index.html
Last active Jan 21, 2016
aad single signon in javascript
View index.html
<html>
<head>
</head>
<body>
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.0/js/adal.js"></script>
<script>
// register app at https://apps.dev.microsoft.com/
var ac = new AuthenticationContext({
clientId: 'clientId',
tenant: 'tenantId',
@prabirshrestha
prabirshrestha / web.go
Last active Aug 29, 2015
strongly typed context in golang - github.com/gohttp/app
View web.go
package main
import (
"fmt"
"log"
"net/http"
"github.com/gohttp/app"
"github.com/gorilla/context"
)
You can’t perform that action at this time.