Skip to content

Instantly share code, notes, and snippets.

<style>
#file {
height: 300px;
font-size: 300px;
}
</style>
<style>
...
#file-field-window {
overflow:hidden;
}
</style>
<div id="file-field-window">
<input type="file" name="file" id="file" value="" />
</div>
<style>
#file {
...
right: 0;
position: absolute;
}
#file-field-window {
...
position:relative;
}
<style>
#file {
...
opacity: 0.01;
}
...
</style>
<div id="file-field-window">
<input type="file"... />
@jsakamoto
jsakamoto / Global.asax.cs
Created October 10, 2012 00:48
Respond Real HTTP status code in custome error page
using System;
using System.Configuration;
using System.Web;
using System.Web.Configuration;
public class MvcApplication : System.Web.HttpApplication
{
public override void Init()
{
base.Init();
@jsakamoto
jsakamoto / UnitTest1.cs
Created November 1, 2012 12:45
How to write unit test code more simply.
// PM> Install-Package ChainingAssertion
// http://nuget.org/packages/ChainingAssertion
// http://chainingassertion.codeplex.com/
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
public class DateHelper
{
public static DateTime? ToNullableDate(string input)
#r "System.Xml.Linq"
open System
open System.Xml
open System.Xml.Linq
open System.IO
if fsi.CommandLineArgs.Length < 2 then
raise <| new Exception("error: .gan file name not specified.")
let Element name (xelem:XElement) = xelem.Element(XName.Get(name))
@jsakamoto
jsakamoto / Index.cs
Last active December 12, 2015 02:18
@{
var comics = new[] {
new {Title = "Groo", Publisher = "Dark Horse Comics"},
new {Title = "Spiderman", Publisher = "Marvel"}
};
}
<h1>Normal</h1>
<table border="1">
@jsakamoto
jsakamoto / Script1.fsx
Created March 4, 2013 03:59
How to retrieve Japanese Holidays from Apple web site with DDay.ICal library by F# Script.
// download from http://sourceforge.net/projects/dday-ical/files/
#r @"DDay.Collections.dll"
#r @"DDay.iCal.dll"
open DDay.iCal
open System
open System.Linq
new Uri("http://ical.mac.com/ical/Japanese32Holidays.ics")
|> iCalendar.LoadFromUri
|> Seq.collect (fun x -> x.Events)
@jsakamoto
jsakamoto / Program.cs
Created March 4, 2013 01:38
How to retrieve Japanese Holidays from Apple web site with DDay.ICal library.
using DDay.iCal;
using System;
using System.Linq;
// PM> Install-Package DDay.iCal
class Program
{
static void Main(string[] args)
{
var cals = iCalendar.LoadFromUri(new Uri("http://ical.mac.com/ical/Japanese32Holidays.ics"));