Skip to content

Instantly share code, notes, and snippets.

@thinkAmi
thinkAmi / linq2twitter_sample.cs
Created April 25, 2014 21:03
LINQToTwitterライブラリで、ツイートしたり、ツイートを取得するサンプル (WPFでTextBoxとButtonを使ってます)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
@thinkAmi
thinkAmi / Berksfile
Created January 24, 2014 23:01
GDG信州 2014.Jan での発表時のコード
site :opscode
metadata
cookbook 'git'
@thinkAmi
thinkAmi / win_fetch_cacerts.rb
Created December 17, 2013 21:32
https://gist.github.com/fnichol/867550 にある win_fetch_cacerts.rb に対し、取得するpemファイルの保存先をRailsInstallerのパスから d:\hoge\ 以下に変更したもの
require 'net/http'
# create a path to the file "d:\hoge\cacert.pem"
cacert_file = File.join(%w{d: hoge cacert.pem})
Net::HTTP.start("curl.haxx.se") do |http|
resp = http.get("/ca/cacert.pem")
if resp.code == "200"
open(cacert_file, "wb") { |file| file.write(resp.body) }
puts "\n\nA bundle of certificate authorities has been installed to"
@thinkAmi
thinkAmi / Program.cs
Created December 6, 2013 20:47
LINQ to Objectsで、複数Join・複合キーでGroup化・並び替えをして、サマリを出す
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LinqSample
{
class Program
{
@thinkAmi
thinkAmi / Program.cs
Created December 5, 2013 21:19
独自の名前空間を持つXMLを、LINQやXPathを使い、いろいろな方法でデータ取得する例
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// Add
using System.Net;
using AmazonProductAdvtApi;
using System.Xml;
using System.Xml.XPath;
@thinkAmi
thinkAmi / ExcelDna.dna
Created November 26, 2013 21:43
Excel-DNAでExcelのワークシートを操作するサンプル
<DnaLibrary RuntimeVersion="v4.0" Name="WorksheetExample" Language="CS">
<ExternalLibrary Path="WorksheetExample.dll"/>
</DnaLibrary>
@thinkAmi
thinkAmi / Vagrantfile
Created November 12, 2013 21:35
Vagrant + Berkshelf + Capistrano 3 時のVagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
config.vm.hostname = "hoge"
#config.vm.hostname = "hoge-berkshelf"
@thinkAmi
thinkAmi / Berksfile
Created November 11, 2013 21:24
Berkshelf で rbenv + Ruby 環境を作成する時の Berksfile と Vagrantfile
site :opscode
metadata
cookbook 'apt'
cookbook 'git'
cookbook 'ruby_build'
cookbook 'rbenv', github: "fnichol/chef-rbenv"
@thinkAmi
thinkAmi / revaliases
Created October 9, 2013 20:07
sSMTPの設定ファイル。Gmailアカウントの場合、「hoge@example.com」をGmailのアドレスに、パスワード「fuga」をGmailのパスワードへと変更する。
root:hoge@example.com:smtp.gmail.com:587
localusername:hoge@example.com:smtp.gmail.com:587
@thinkAmi
thinkAmi / .caffrc
Created October 9, 2013 20:03
caffの設定ファイル。$CONFIG{'email'} と、$CONFIG{'keyid'} を自分のものに直すこと。
# .caffrc -- vim:ft=perl:
# This file is in perl(1) format - see caff(1) for details.
$CONFIG{'owner'} = '';
$CONFIG{'email'} = 'hoge@example.com';
#$CONFIG{'reply-to'} = 'foo@bla.org';
# You can get your long keyid from
# gpg --with-colons --list-key <yourkeyid|name|emailaddress..>
#