Skip to content

Instantly share code, notes, and snippets.

View xhiroga's full-sized avatar

Hiroaki Ogasawara xhiroga

View GitHub Profile
@yosemitebandit
yosemitebandit / send_pdf_with_boto_ses.py
Created June 6, 2012 17:56
send PDF attachment with boto and SES
''' quick example showing how to attach a pdf to multipart messages
and then send them from SES via boto
'''
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import boto
@hamadu
hamadu / helpme.txt
Created November 15, 2012 06:19
問題が解けないとき/20分経っても方針が見えないならここを見る。
20分経っても方針が見えないならここを見る。数字が小さいほど優先度高い。
1. 問題文に見落としはないですか
- そもそもちゃんと問題読んだ?別の問題を解こうとしてない?
-- 似た問題を解いたことがある場合は特に注意する。
- 制約条件はちゃんと読みましたか
-- 指数時間のアルゴリズムで間に合ったりしない?
-- グラフは特殊な形をしてませんか
--- 木だったり、閉路の数だったり
--解けるものを「解けない」と勘違いしてませんか
# import libraries
import time
import os
while True: # do forever
os.system('fswebcam -r 320x240 -S 3 --jpeg 50 --save /home/pi/to_transmit/%H%M%S.jpg') # uses Fswebcam to take picture
@risgk
risgk / arith_big.rb
Last active March 6, 2021 07:40
TAPL 演習3.5.17 Rubyでの実装例
# TYPES AND PROGRAMMING LANGUAGES by Benjamin C. Pierce Copyright (c)2002 Benjamin C. Pierce
# Excercise 3.5.17
class Array
def isnumericval
t = self
case
when t[0] == :zero
true
when t[0] == :succ
@meyju
meyju / cloudwatch_logs_download.sh
Created May 5, 2015 09:11
Script downloads all logs from aws cloudwatch logs
#!/usr/bin/env bash
#
# Copyright 2015 Julian Meyer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@hashrock
hashrock / diag.md
Last active February 26, 2024 05:51
作図系ツール・ライブラリまとめ

シーケンス図とかフローチャートをしごとで描画することになった場合、 テキストから生成できたら楽なので、それ系のツールまとめ

GraphViz

http://www.graphviz.org/

  • C製
  • Doxygen, Moinmoinなどと連携可能
  • ブロック図、クラス図、ネットワーク図など
@res0nat0r
res0nat0r / list-regions.go
Created December 9, 2015 02:22
List EC2 regions in Go
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
)
func main() {
@mono0926
mono0926 / commit_message_example.md
Last active July 20, 2024 08:30
[転載] gitにおけるコミットログ/メッセージ例文集100
@umrashrf
umrashrf / aws_ses.bash
Created July 26, 2016 19:05
Amazon AWS CLI - SES SEND EMAIL
sudo pip install awscli
aws configure
aws ses send-email \
--from "john@gmail.com" \
--destination "ToAddresses=mike@gmail.com" \
--message "Subject={Data=from ses,Charset=utf8},Body={Text={Data=ses says hi,Charset=utf8},Html={Data=,Charset=utf8}}"
@monkut
monkut / Ubuntu1604py36Dockerfile
Last active June 14, 2023 20:31
Base Docker image for ubuntu-16.04 & Python3.6
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git