Skip to content

Instantly share code, notes, and snippets.

@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 / 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"
)
export function increment() {
return {
type: 'INCREMENT'
};
}
function decrement() {
return {
type: 'DECREMENT'
};
@prabirshrestha
prabirshrestha / Readme.txt
Created July 27, 2010 07:25 — forked from dieseltravis/Readme.txt
YUI compressor
Example usage:
...in <head>:
<link rel="stylesheet" type="text/css" href="/YuiCompressor.ashx?css=reset,style" />
...just before the </body>:
<script type="text/javascript" src="/YuiCompressor.ashx?js=main,someotherscript"></script>
Changelog:
2010-02-18: Updated to support HTTP compression
@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
@prabirshrestha
prabirshrestha / Find Control Recursively
Created October 12, 2010 06:25
Find Controls Recursive
namespace Helpers.Net.Web
{
using System.Web.UI;
public static partial class WebHelper
{
/// <summary>
/// Finds a Control Recursively.
/// </summary>
/// <typeparam name="T">Type control.</typeparam>
@prabirshrestha
prabirshrestha / gist:629705
Created October 16, 2010 11:44
Resharper LiveTemplate for BsdLicense
<TemplatesExport family="Live Templates">
<Template uid="794587b4-3bf5-4e82-83a7-525babed327f" shortcut="bsdlicense" description="BSD License" text="/**&#xD;&#xA;=====================================================================================&#xD;&#xA;$ProjectName$ is intended to be used in both open-source and commercial environments.&#xD;&#xA;=====================================================================================&#xD;&#xA;3-clause license (&quot;New BSD License&quot;)&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Copyright (c) $Year$, $Author$&#xD;&#xA;All rights reserved.&#xD;&#xA;&#xD;&#xA;Redistribution and use in source and binary forms, with or without&#xD;&#xA;modification, are permitted provided that the following conditions are met:&#xD;&#xA;&#xD;&#xA; * Redistributions of source code must retain the above copyright&#xD;&#xA; notice, this list of conditions and the following disclaimer.&#xD;&#xA; * Redistributions in binary form must reproduce the above copyright&#xD;&#xA; notice
@prabirshrestha
prabirshrestha / install_dependencies.rb
Created October 16, 2010 14:19
ruby gems install dependencies
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
required_version = Gem::Requirement.new "> 1.8.5"
unless required_version.satisfied_by? Gem.ruby_version then
abort "Expected Ruby Version #{required_version}, was #{Gem.ruby_version}"
end
@prabirshrestha
prabirshrestha / hgrc
Created October 17, 2010 07:57
hgrc file for nupack
[paths]
default = https://hg01.codeplex.com/forks/prabirshrestha/cls
[extensions]
reviewboard = D:\Prabir\Documents\PortableApps\msys\msys\1.0\share\mercurial-reviewboard
[reviewboard]
server = http://reviewboard.nupack.com/
user = prabir
@prabirshrestha
prabirshrestha / RemoveWhitespaceWithSplit
Created October 19, 2010 06:00
Remove Whitespace with split
// http://www.aspdotnetfaq.com/Faq/How-to-remove-duplicate-Whitespace-Characters-from-a-string.aspx
public static string RemoveWhitespaceWithSplit(string inputString)
{
StringBuilder sb = new StringBuilder();
string[] parts = inputString.Split(new [] { ' ', '\n', '\t', '\r', '\f', '\v' }, StringSplitOptions.RemoveEmptyEntries);
int size = parts.Length;
for (int i = 0; i < size; i++)
sb.AppendFormat("{0} ", parts[i]);