Skip to content

Instantly share code, notes, and snippets.

View civic's full-sized avatar

Takashi Sasaki civic

View GitHub Profile
from concurrent.futures import ThreadPoolExecutor
import time
def func():
n = 0
while n < 300_000_000:
n += 1
if __name__ == "__main__":
pool = ThreadPoolExecutor(max_workers=4)
@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 {
@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))
1 2015-09-20 13:29:26 27.7
2 2015-09-20 13:30:26 27.4
3 2015-09-20 13:31:26 27.3
4 2015-09-20 13:32:26 27.1
5 2015-09-20 13:33:26 27.0
6 2015-09-20 13:34:26 26.8
7 2015-09-20 13:35:26 26.7
8 2015-09-20 13:36:26 26.7
9 2015-09-20 13:37:26 26.6
10 2015-09-20 13:38:26 26.6
var g=0;var c=$('<img id="cursor" src="http://goo.gl/UFrcIO" style="position: absolute;">').appendTo("body");var doclick=function(){var b=$(".thechosenone");var o=b.offset();c.animate({left:o.left+b.width()/2, top: o.top+b.height()/2}, function(){b.click(); if (g++<50){doclick()}else{$(".missclick").click()}})};doclick();
@civic
civic / in1.txt
Last active August 29, 2015 14:22
oneperson.py
4
2
10 21
3
0 9 9
4
81 67 83 86
3
11 22 30
package java8;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;
@civic
civic / gist:7701433
Last active December 29, 2015 16:59
職場環境 採点表
  • ボールみたいなソファ
  • 椅子(アーロン、オカムラ...etc)
  • パーティション有無
  • マルチモニタ数
  • キーボード提供
  • OS選択の自由
  • 服装の自由
  • フレックスタイム実態の自由度
  • フリードリンク
  • フリーお菓子