Skip to content

Instantly share code, notes, and snippets.

View abhishekbhalani's full-sized avatar
🎄
working on latest framework...

Abhishek B. abhishekbhalani

🎄
working on latest framework...
View GitHub Profile
<div>&nbsp;</div>
<!-- #### BEGIN: Quick Link #### -->
<table class="review">
<tbody>
<tr>
<td class="review-title">
<div class="review-title">In a Hurry?</div>
</td>
</tr>
<tr>
@ryanflorence
ryanflorence / static_server.js
Last active February 27, 2025 06:28
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@hayashih
hayashih / RedirectNoTrailingSlashUrl.cs
Created November 29, 2010 11:29
ASP.NET MVC Grobal.asax.cs sample for redirect no trailing slash url.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
namespace MyMvcWebSite
{
@jonleighton
jonleighton / base64ArrayBuffer.js
Last active April 1, 2025 05:52
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@liddellj
liddellj / DateTimeExtensions.cs
Created May 19, 2011 11:39
C# DateTime to Unix Timestamp Extension Method
public static class DateTimeExtensions
{
public static long ToUnixTimestamp(this DateTime d)
{
var duration = d - new DateTime(1970, 1, 1, 0, 0, 0);
return (long)duration.TotalSeconds;
}
}
@swoker
swoker / EnumLoopExample.cs
Created May 25, 2011 16:24
C#: Loop an Enum with Description Strings
using System;
using System.ComponentModel;
using System.Reflection;
namespace EnumLoopExample
{
class Program
{
enum Car
{
@JamieLottering
JamieLottering / custom_theme.css
Created July 3, 2011 22:44
DropKick Examples
.dk_theme_black {
background: #aebcbf;
background: -moz-linear-gradient(top,
#aebcbf 0%,
#6e7774 50%,
#0a0e0a 51%,
#0a0809 100%
);
background: -webkit-gradient(linear,
left top,
@Encosia
Encosia / _invoice.tpl.htm
Created August 18, 2011 03:11
Remote template loading with jQuery Templates
<script id="invoiceTemplate" type="x-jquery-tmpl">
<table class="invoice">
<thead>
<tr>
<th>Service/Item</th>
<th>Price</th>
<th>Qty</th>
</tr>
</thead>
<tbody>
@andyj
andyj / excel2html.htm
Created September 16, 2011 04:13
Paste Excel in to HTML to create at <table>
<html>
<head>
<style>
*{
font-family: arial;
font-size: 11px;
}
table{
border-collapse: collapse;
border: 1px solid silver;
@mitchellrj
mitchellrj / tree.html
Created October 28, 2011 00:09
HTML & CSS vertical tree layout
<html>
<head>
<title>HTML &amp; CSS tree</title>
<!-- tree -->
<style type="text/css">
ul.tree {
overflow-x: auto;
white-space: nowrap;
}