Skip to content

Instantly share code, notes, and snippets.

for (i = 0; i < array.length; i++) {
$(".hoge").each(function() {
alert("hoge");
});
}
@jirolabo
jirolabo / user_uploads_gapi.html
Last active September 30, 2016 04:02
YouTube Data API (v3) からデータ取得(Google APIライブラリ )
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
var API_KEY = '__YOUR_API_KEY__';
function requestUserUploadsPlaylistId() {
var request = gapi.client.youtube.channels.list({
part: 'contentDetails',
forUsername: 'GoogleDevelopers'
});
@jirolabo
jirolabo / user_uploads_ajax.html
Last active September 30, 2016 04:11
YouTube Data API (v3) からデータ取得($.ajax)
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
var API_KEY = '__YOUR_API_KEY__';
function requestUserUploadsPlaylistId() {
$.ajax({
url: 'https://www.googleapis.com/youtube/v3/channels',
type: 'GET',
data: {
@jirolabo
jirolabo / youtube_background.html
Last active September 30, 2016 07:21
Youtube IFrame Player API のプレイヤーをページ背景にしする(音量はミュート)
<html>
<head>
<style>
#bg-player, #bg-pattern {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
@jirolabo
jirolabo / mdbver.vbs
Last active April 11, 2018 14:13
Show *.mdb file Access version
Set dao = WScript.CreateObject("DAO.DBEngine.36")
Set db = dao.OpenDatabase("sample.mdb")
WScript.Echo db.Properties("AccessVersion")
'Version 02.00 for Access 2.0
'Version 06.68 for Access 95
'Version 07.53 for Access 97 (8.0)
'Version 08.50 for Access 2000 (9.0)
'Version 09.50 for Access 2002/2003 (10.0/11.0)
@jirolabo
jirolabo / mdbver.ps1
Created April 11, 2018 14:16
Show *.mdb file Access version by PowerShell
$dao = new-object -comobject DAO.DBEngine.36
$db = $dao.OpenDatabase("sample.mdb")
$db.Properties("AccessVersion")
#Version 02.00 for Access 2.0
#Version 06.68 for Access 95
#Version 07.53 for Access 97 (8.0)
#Version 08.50 for Access 2000 (9.0)
#Version 09.50 for Access 2002/2003 (10.0/11.0)
@jirolabo
jirolabo / ombiningDictionary.vb
Created May 20, 2018 13:40
Combining Dictionary
Dim dictA = New Dictionary(Of String, String) From {{"hoge", "fuga"}}
Dim dictB = New Dictionary(Of String, String) From {{"foo", "bar"}}
Dim dictC = dictA.Concat(dictB).ToDictionary(Function(i) i.Key, Function(i) i.Value)
For Each item In dictC
Console.WriteLine($"{item.Key} {item.Value}")
Next
@jirolabo
jirolabo / export_diff_zip.bat
Created May 30, 2018 13:00
SourceTree(Git)から差分ファイルを抽出してzipに圧縮
if "%2" EQU "" (
set PARAM1=HEAD
set PARAM2=%1
) else (
set PARAM1=%1
set PARAM2=%2
)
chcp 65001
setlocal enabledelayedexpansion
@jirolabo
jirolabo / CustomControllerFactory.cs
Created November 16, 2018 13:32
ASP.NET MVC SessionStateBehavior
public class CustomControllerFactory : DefaultControllerFactory
{
protected override SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, Type controllerType)
{
if (requestContext.HttpContext.Request.IsAjaxRequest())
{
// ajax の場合はセッションを読み取り専用にする
return SessionStateBehavior.ReadOnly;
}
return base.GetControllerSessionBehavior(requestContext, controllerType);
@jirolabo
jirolabo / http-Startup.cs
Created December 8, 2018 10:49
Differences due to configuration for HTTPS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;