Skip to content

Instantly share code, notes, and snippets.

@nakaji
nakaji / gist:3d84623ce4c7477fae9209ec43058182
Created August 31, 2016 08:45
Azure Cloud Backupの実行結果確認通知(メール)
#
# Azure Cloud Backupの実行結果確認通知(メール)
#
# 基本設定
$from = "admin@example.com"
$to = "caution@example.com"
$password = "xxxx"
$smtp = "smtp.example.com"
$port = "587"
Invoke-Sqlcmd -Query "exec sp_databases" | ?{ -not (@("master","tempdb","msdb","model") -contains $_.Item(0)) } | %{
$datebaseName = $_.Item(0)
Write-Host ("■ {0}のフルバックアップを実行します" -f $datebaseName)
$backupSql=@"
BACKUP DATABASE {0}
TO DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup\{0}.Bak'
WITH FORMAT,
using System;
using System.Net.Mail;
using SendGrid;
namespace SendGripSample
{
class Program
{
static void Main( string[] args)
{
@nakaji
nakaji / gist:8e6efe6297b84d8aef74
Last active August 29, 2015 14:15
Amazon Product Advertising API Sample
using System;
using System.Linq;
using System.Xml.Linq;
namespace AmazonProductAdvtApi
{
class ItemLookupSample
{
private const string MY_AWS_ACCESS_KEY_ID = "{Access Key ID}";
private const string MY_AWS_SECRET_KEY = "{Secret Access Key}";
@nakaji
nakaji / file0.html
Created December 18, 2014 19:45
GoogleMapで表示されている地図の範囲を表示する ref: http://qiita.com/nakaji/items/68e86712d88d22365233
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>表示されている地図の範囲を表示する</title>
<script src="scripts/jquery-1.10.2.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
$(function () {
google.maps.event.addDomListener(window, 'load', initialize);
@nakaji
nakaji / gist:c3d9febce365e680f52e
Created December 3, 2014 03:53
paizaオンラインハッカソン4 Lite ミッション2
public class Hello{
public static void Main(){
// 自分の得意な言語で
// Let's チャレンジ!!
var line = int.Parse(System.Console.ReadLine());
long total = 0;
for (var i=0; i<line; i++)
{
var buf = System.Console.ReadLine().Split(' ');
var needs = int.Parse(buf[0]);
@nakaji
nakaji / file0.cs
Created September 1, 2014 16:55
C#でDozensのDNSレコードを操作する ref: http://qiita.com/nakaji/items/008090c0fc8173afce53
using System;
using System.Linq;
using System.Net;
using Codeplex.Data;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
@nakaji
nakaji / file0.html
Created July 23, 2014 16:24
GoogleMapで住所などから位置を取得して表示するサンプル ref: http://qiita.com/nakaji/items/eebdab5ddf9b8af16f76
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>住所などから位置を取得する</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
@nakaji
nakaji / file0.html
Created July 23, 2014 15:00
GoogleMapでクリックされた位置を取得するサンプル ref: http://qiita.com/nakaji/items/83e698e283ba31cbb6a2
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>クリックされた位置を取得する</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
@nakaji
nakaji / HomeController
Created July 18, 2014 17:31
アップロードしたファイルを保存する ref: http://qiita.com/nakaji/items/f19a957b3b214bc96982
using System.Web;
using System.Web.Mvc;
namespace WebApplication4.Controllers
{
public class HomeController : Controller
{
[HttpGet]
public ActionResult Index()
{