Skip to content

Instantly share code, notes, and snippets.

// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+k",
"command": "git.stage",
"when": "workbench.scm.active"
},
{
"key": "ctrl+j",
"command": "git.unstage",
@satetsu888
satetsu888 / modify.py
Created November 28, 2020 14:00
ポケモンシールホルダーキャンペーン用の工作
from mitmproxy import http
SCRIPT = '''
<script>
const constraints = {
audio: false,
video: {
width: 150,
height: 300,
facingMode: "environment"
@satetsu888
satetsu888 / listup.rb
Created September 30, 2019 07:46
list up rails mode unique validations and table unique indexes
require 'json'
results = {}
ActiveRecord::Base.connection.tables.each do |table_name|
klass = table_name.classify.safe_constantize
next unless klass
results[table_name] = {}
@satetsu888
satetsu888 / partiton of a set
Last active November 18, 2015 12:11
calc partition of a set for sundrug
from ortoolpy import set_partition
import itertools
import sys
import random
LOW_LIMIT = 5000
LOW_LIMIT2 = 3000
FILE_NAME = 'data.txt'
def calc_weight(combination):
@satetsu888
satetsu888 / amaten rate
Created June 2, 2015 14:34
amatenの価格調べ
require 'nokogiri'
require 'open-uri'
base_url = 'https://amaten.jp/exhibitions/past_gifts?page=%s&type=amazon'
last_line = 0;
current_line = 0;
page = 1;
loop do
@satetsu888
satetsu888 / script1.t
Created April 13, 2014 15:02
競技プログラミング的なことをするときに使う
use strict;
use warnings;
use Test::More;
use Data::Dumper;
use Capture::Tiny qw/ capture /;
subtest script1 => sub {
io_test('script1.pl', "<abc> <xyz>\nhoge<abc>piyo<xyz>", "piyo\n");
io_test('script1.pl', "<abc> <ijk>\n<abc>xxxx<ijk>yyyyyy<abc>zzz<ijk>", "xxxx\nzzz\n");
@satetsu888
satetsu888 / gist:5955519
Last active December 19, 2015 12:29
ボーリング嫌い
#!/usr/bin/perl
use strict;
use warnings;
my $input = $ARGV[0];
# temporary
# TODO 切り取る