Skip to content

Instantly share code, notes, and snippets.

View civic's full-sized avatar

Takashi Sasaki civic

View GitHub Profile
@civic
civic / StudyLambda1.java
Created February 17, 2024 10:48
StudyLambda1.java ランタイムフック実装
package com.example;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.SQSEvent;
import org.crac.Core;
import org.crac.Resource;
import java.util.UUID;
@civic
civic / StudyLambda1.java
Created February 17, 2024 10:24
StudyLambda1 初期化処理あり
package com.example;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.SQSEvent;
import java.util.UUID;
public class StudyLambda1 implements RequestHandler<SQSEvent, Void>, Resource {
#######################################################################
#
# This is the main Nginx configuration file.
#
# More information about the configuration options is available on
# * the English wiki - http://wiki.nginx.org/Main
# * the Russian documentation - http://sysoev.ru/nginx/
#
#######################################################################
@civic
civic / hatena.py
Created November 14, 2017 02:24
はてなブックマークをrequests,BeatifulSoupでスクレイピング
from bs4 import BeautifulSoup
import requests
import time
url = 'http://b.hatena.ne.jp/search/text?safe=on&q=Python&users=50'
for n in range(3): # 3ページで中断
res = requests.get(url)
soup = BeautifulSoup(res.content, features='lxml')
@civic
civic / a.py
Created February 16, 2017 06:04
あたえられた文字列中に含まれる単語の個数を単語ごとにカウントするpython
import collections
import re
text = "I have a pen. I have a apple. oh!! Apple pen! I have a pen. I have a pineapple. oh!! Pineapple pen! Apple pen. Pineapplepen. Pen pineapple apple pen."
collections.Counter(s.lower() for s in re.split(r'[^\w]+',text))
@civic
civic / gist:7701433
Last active December 29, 2015 16:59
職場環境 採点表
  • ボールみたいなソファ
  • 椅子(アーロン、オカムラ...etc)
  • パーティション有無
  • マルチモニタ数
  • キーボード提供
  • OS選択の自由
  • 服装の自由
  • フレックスタイム実態の自由度
  • フリードリンク
  • フリーお菓子
@civic
civic / gist:6751695
Last active December 24, 2015 05:39
traitがどういうJavaバイトコードになるのか
trait Weapon  {
  val strength: Int
}

scalac後javapで表示

$ javap -c Weapon
Compiled from "test.scala"
public interface Weapon {

public abstract int strength();

@civic
civic / cancel-policy.md
Created August 21, 2013 01:42
長岡IT開発者勉強会の懇親会キャンセルポリシー

長岡IT開発者勉強会の懇親会キャンセルポリシー

懇親会をキャンセルした場合のキャンセル料金について。開催3日以内のキャンセルの場合はキャンセル料が発生します。

キャンセル料金

懇親会実施日を含む3日前からのキャンセルの場合、参加料金をキャンセル料金とさせて頂きます。
(例:10日開催の場合8日のキャンセルからキャンセル料金がかかります)

ご連絡なく不参加になった場合はキャンセル料金を頂きます。

@civic
civic / gist:5394787
Created April 16, 2013 10:00
例えば非同期処理のcallback関数などにあえて関数名をつけるのはどうだろう?
//例えば非同期処理のcallback関数などにあえて関数名をつけるのはどうだろう?
someAjaxFunction("parmaeter",
function 販売価格の取得に成功した時(calculatedSalesPrice){
console.log(calculatedSalesPrice);
},
function なんかエラー(e){
console.log(e);
}
);
//変更前
@civic
civic / dynamic.py
Last active December 15, 2015 07:19
class Dynamic:
def __setattr__(self, name, value):
self.__dict__[name] = value
def __getattr__(self, name):
return self.__dict__[name]
d = Dynamic()
d.hoge = 'bar'
d.neko = 'nyan'