Skip to content

Instantly share code, notes, and snippets.

@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 June 3, 2022 01:19
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(),
@prabirshrestha
prabirshrestha / docker-fig.txt
Last active May 25, 2017 04:53
docker and fig
http://code.tutsplus.com/tutorials/easily-deploy-redis-backed-web-apps-with-docker--cms-20405
vagrant box add ubuntu12 http://files.vagrantup.com/precise64.box
vagrant box init ubuntu12
vagrant box up
vagrant ssh
sudo apt-get update
sudo apt-get install -y curl
curl -s https://get.docker.io/ubuntu/ | sudo sh
# brew install --HEAD https://gist.githubusercontent.com/prabirshrestha/9824933/raw/fleetctl.rb -v
require 'formula'
class Fleetctl < Formula
homepage 'https://github.com/coreos/fleet'
head 'https://github.com/coreos/fleet.git', :tag => 'v0.1.4'
def install
system "./build"