Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
prabirshrestha / termbox-sample.go
Last active September 14, 2015 04:33
termbox-go with (partial) react style rendering.
package main
import (
"time"
"github.com/nsf/termbox-go"
)
type appState struct {
endEventLoop bool
export function increment() {
return {
type: 'INCREMENT'
};
}
function decrement() {
return {
type: 'DECREMENT'
};
@prabirshrestha
prabirshrestha / index.html
Last active January 21, 2016 06:57
aad single signon in javascript
<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 August 29, 2015 14:17
strongly typed context in golang - github.com/gohttp/app
package main
import (
"fmt"
"log"
"net/http"
"github.com/gohttp/app"
"github.com/gorilla/context"
)
@prabirshrestha
prabirshrestha / goreman.nuspec
Created February 17, 2015 06:13
chocolatey goreman
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>goreman</id>
<version>0.0.6.0</version>
<title>goreman</title>
<authors>mattn</authors>
<owners>prabirshrestha</owners>
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
<projectUrl>https://github.com/mattn/goreman</projectUrl>
@prabirshrestha
prabirshrestha / .bash_profile
Last active July 8, 2025 17:28
my terminal settings for windows
# curl -Lk https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.bash_profile -o ~/.bash_profile
[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh # This loads NVM
export PATH="$HOME/.cargo/bin:$HOME/go/bin:$HOME/Library/Python/3.7/bin:$PATH"
export PATH="$HOME/.config/nvim/plugins/vim-themis/bin:$PATH"
stty -ixon
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'

Keybase proof

I hereby claim:

  • I am prabirshrestha on github.
  • I am prabir (https://keybase.io/prabir) on keybase.
  • I have a public key whose fingerprint is F7B4 722B F1F8 DC22 52E2 20F8 2425 0E11 921B 2564

To claim this, I am signing this object:

@prabirshrestha
prabirshrestha / HelloWorldModule.cs
Last active September 15, 2016 09:29
Nancy ReactJS View Engine
using Nancy;
namespace NancyReactServerSide
{
public class HelloWorldModule : NancyModule
{
public HelloWorldModule()
{
// note: models are passed as reactjs props. ViewBag is ignored
Get["/"] = _ => View["hello", new { firstName = "Prabir", lastName = "Shrestha" }];
@prabirshrestha
prabirshrestha / Bootstrapper.cs
Last active March 31, 2018 16:57
Server side reactjs rendering in Nancy with React.NET
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context)
{
base.RequestStartup(container, pipelines, context);
var react = new ReactEnvironment(
new JavaScriptEngineFactory(),
new ReactSiteConfiguration(),
new NullReactCache(),