This file contains hidden or 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
<script> | |
// (省略) | |
function onAuthenticated(token, authWindow) { | |
if (token) { | |
if (authWindow) { | |
removeLoginButton(); | |
authWindow.close(); | |
} |
This file contains hidden or 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
Function FileStream(url As String) As ActionResult | |
Try | |
Dim req = HttpWebRequest.CreateHttp(url) | |
Dim res = DirectCast(req.GetResponse, HttpWebResponse) | |
Response.ContentType = res.ContentType | |
res.GetResponseStream.CopyTo(Response.OutputStream) | |
Catch ex As WebException | |
If ex.Status = System.Net.WebExceptionStatus.ProtocolError Then |
This file contains hidden or 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
If Request.UrlReferrer Is Nothing OrElse Request.UrlReferrer.Host <> Request.Url.Host Then | |
Response.StatusCode = HttpStatusCode.BadRequest | |
Return New EmptyResult | |
End If |
This file contains hidden or 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
Function Image() As ActionResult | |
Dim path = Server.MapPath("~/App_Data/images/") | |
Dim bmp = New Bitmap(IO.Path.Combine(path, "sample.png")) | |
Dim ms = New MemoryStream() | |
bmp.Save(ms, Imaging.ImageFormat.Png) | |
bmp.Dispose() | |
ms.Position = 0 | |
Return New FileStreamResult(ms, "image/png") |
This file contains hidden or 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
public class Hello{ | |
public static void Main(){ | |
// Here your code ! | |
System.Console.WriteLine("Hello C#"); | |
///aaa | |
} | |
} |
This file contains hidden or 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
// 現時刻の status id | |
var currentId = Convert.ToInt64( | |
DateTime.UtcNow.Subtract( | |
new DateTime(1970, 1, 1).AddMilliseconds(1288834974657) | |
).TotalMilliseconds | |
) << 22; | |
// 10 minutes 分のミリ秒 | |
var offset = Convert.ToInt64( | |
TimeSpan.FromMinutes(10).TotalMilliseconds) << 22; |
This file contains hidden or 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
function twcm_get_description() | |
{ | |
global $post; | |
$twcm_options=twcm_get_options(); | |
//$desc=trim(get_the_excerpt()); | |
//if($desc=="") | |
//{ | |
//$desc=$post->post_content; |
This file contains hidden or 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
' NG | |
tokens.Statuses.Update(Function(status As String) "hello") | |
' OK | |
tokens.Statuses.Update({Function(status As String) "hello"}) |
This file contains hidden or 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
tokens.Statuses.Update(status => "hello"); |
This file contains hidden or 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
// スキーマ定義 | |
var JSRel = require("jsrel"); | |
var db = JSRel.create("dbname", {schema: | |
{ user: { name : true, is_activated: "on", $uniques: "name"}, | |
book: { title: true, price: 1, author: "user", $indexes: "title" }, | |
}}); | |
// データの挿入 | |
if (!db.loaded) { // if loaded from saved data, omits this section | |
var u1 = db.ins('user', {name: 'shinout'}); |