Skip to content

Instantly share code, notes, and snippets.

@yamamaya
yamamaya / gist:f1e465784ad4edb0d4690ee2b82932d8
Created August 31, 2017 09:48
VS2013でWindowsAzure.Storage 8.4.0をインストールする方法
Install-Package System.Linq.Queryable -Version 4.3.0
Install-Package WindowsAzure.Storage -Version 8.4.0
@yamamaya
yamamaya / main.py
Last active August 28, 2017 08:38
NETDWARF obsidianからセンサーの情報をHTTPで定期的に送信する
import time
import NDSPI
from NDCore import ConnectLib, NDHTTPLib, PowerLib
def main():
try:
now = PowerLib.get_time()
timestamp = '{0:04d}{1:02d}{2:02d}{3:02d}{4:02d}{5:02d}'.format(
now['year']+2000,
now['month'],
@yamamaya
yamamaya / SendSMS2.py
Created August 24, 2017 02:10
NETDWARF obsidianからSMSを送る。シャットダウンしてENによるトリガーで起動。
from NDCore import ConnectLib, SMSLib
def main():
# ネットワークに接続する
print 'Connecting...',
ConnectLib.connect()
print 'OK'
  # SMSを送信する
phone_number = 'xxxxxxxxxxx'
@yamamaya
yamamaya / SendSMS.py
Created August 24, 2017 02:07
NETDWARF obsidianでSMSを送る
from NDCore import ConnectLib, SMSLib
def main():
# ネットワークに接続する
print 'Connecting...',
ConnectLib.connect()
print 'OK'
  # SMSを送信する
phone_number = 'xxxxxxxxxxx'
@yamamaya
yamamaya / OpenTWImage.js
Created April 24, 2017 11:54
TweetDeckとTwitter webで画像を拡大表示するブックマークレット
javascript:(function(){var%20s=document.querySelector(".media-img");if(!s){s=document.querySelector(".media-image");}s=s.src.replace(":small",":large");window.open(s);})();
@yamamaya
yamamaya / gist:4bf14905e3d0469594630de1d21f968e
Created August 1, 2016 06:36
What exception should I throw?
namespace Sample1 {
class Program {
static void Main( string[] args ) {
Class1 class1 = new Class1();
Console.WriteLine( class1[ DateTime.Now.Second ].ToString() );
}
}
public class Class1 {
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>IDisposable Implementation</Title>
<Shortcut>idisp</Shortcut>
<Description>
How Dispose(bool) should be implemented in a class that uses managed
and native resources.
</Description>
$.ajax( {
type: "GET",
url: "/command.cgi?op=190&CTRL=0x1f&DATA=" + value,
cache: true,
dataType: "json",
timeout: 3000,
beforeSend: function( jqXHR, settings ) {
jqXHR.setRequestHeader( "If-Modified-Since", "Thu, 01 Jan 1970 00:00:00 GMT" );
}
} ).done( function( data, textStatus, jqXHR ) {
@yamamaya
yamamaya / DrawCircle.v
Created June 29, 2014 07:11
コードの化石の断片
module DrawCircle(
input CLOCK,
input nRESET,
input START,
input signed [11:0] X0,
input signed [10:0] Y0,
input signed [11:0] R,
input FILL,
output signed [11:0] X,
output signed [10:0] Y,
@yamamaya
yamamaya / gist:217ddb03ada591a01bf5
Created June 13, 2014 11:42
convert bare word to string literal
#define message NYA!
// Preprocessor magic!
#define _STRING(str) #str
#define STRING(str) _STRING(str)
int main(void) {
printf( "%s\n", STRING( message ) );
return 0;
}