This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#tell-me-wys-link { | |
position:fixed; | |
bottom:0; | |
right:-16.9em; | |
background-color: #fff; | |
border: solid 1px #ccc; | |
color:#444; | |
padding: 4px; | |
opacity:0.7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using Microsoft.Owin.FileSystems; | |
public class EmbeddedResourceFileSystem2 : IFileSystem | |
{ | |
protected readonly EmbeddedResourceFileSystem _fileSystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-16"?> | |
<root | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:noNamespaceSchemaLocation="full/path/of/.xsd"> | |
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use TinyGPIO.cs | |
// https://github.com/sample-by-jsakamoto/SignalR-on-RaspberryPi/blob/master/myapp/TinyGPIO.cs | |
using myapp; | |
using System.Web.Mvc; | |
public class HomeController : Controller | |
{ | |
[HttpPut] | |
public ActionResult TurnOnLED() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console.WriteLine("Hello, World."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GDataDB を NuGet Package Manager を使ってプロジェクトに追加しておくこと。 | |
[HttpPost] | |
public ActionResult Index(Attendee attendee) | |
{ | |
// ここでスプレッドシートへ書き込み | |
var gdbclient = new GDataDB.DatabaseClient("(user name)", "(password)"); | |
var db = gdbclient.GetDatabase("Attendees"); | |
var tbl = db.GetTable<Attendee>("Sheet1"); | |
tbl.Add(attendee); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec numofbits bitwidth x = | |
match bitwidth with | |
|0 -> 0 | |
|_ -> (x &&& 1) + numofbits (bitwidth - 1) (x / 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://atnd0.apphb.com/api/attendees | |
public class Attendee | |
{ | |
public int AttendeeID { get; set; } | |
[Required, MaxLength(20)] | |
public string Name { get; set; } | |
[Required, MaxLength(20)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTICE: | |
// This is "concept" sample code. | |
// Not enough resouce disposing, etc. | |
public class MyRemoteAttribute : RemoteAttribute | |
{ | |
public RemotableCustomAttribute(string action, string controller) : base(action, controller) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System;; | |
open System.IO;; | |
let dir = @"c:\workdir";; | |
Directory.GetFiles(dir) | |
|> Seq.map (fun x-> (x, x.Replace("original", "replaced"))) | |
|> Seq.iter (fun (x,y) -> File.Move(x, y));; |
OlderNewer