This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
# CircleCI のキャッシュを functions/*/node_modules に対して効かせるためのスクリプト. | |
# CircleCI 上でのみ実行される. | |
# | |
# ~/node_modules_cache をキャッシュディレクトリとして, | |
# 1. キャッシュのリストア | |
# 2. functions/* で npm install | |
# 3. キャッシュの保存 | |
# を行う. | |
#### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
random_device rnd; | |
mt19937 mt(rnd()); | |
void print_array(int* arr, int len) { | |
cout << *arr; | |
while (--len) cout << ", " << *(++arr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# value = object | array | string | number | true | false | null | |
# object = { string : value \{ , string : value \} } | |
# array = [ value \{ , value \} ] | |
# | |
# string = " .* " | |
# number = -?\d+(\.\d+)?([eE][-+]?\d+) -- "10", "-3.1", "0.34E-6" | |
# true = true | |
# false = false | |
# null = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'pp' | |
source = $*[0] | |
iseq = File.basename(source, ".*") + ".iseq.rb" | |
open(iseq, 'w').puts( | |
"@iseq = " + | |
RubyVM::InstructionSequence.compile_file(source).to_a.pretty_inspect | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max = ARGV[0].to_i | |
1.upto(max) do |i| | |
if i % 15 == 0 | |
puts "FizzBuzz" | |
elsif i % 3 == 0 | |
puts "Fizz" | |
elsif i % 5 == 0 | |
puts "Buzz" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $ g++-4.9 -std=c++1y anonymous_rec.cpp | |
#include <iostream> | |
template<typename Func> | |
struct fixed { | |
Func f; | |
template<typename... Args> | |
auto operator()(Args... args) { | |
return f(fix(f), args...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Text.HTML.Scalpel | |
import Control.Applicative | |
import Control.Monad | |
data Submission | |
= AcSubmission { | |
createdTime :: String, | |
title :: String, | |
user :: String, | |
language :: String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define loop(n, i) for(int i=0;i<n;i++) | |
#define all(v) v.begin(),v.end() | |
using namespace std; | |
using ll = long long; | |
const ll MOD = 1000000007; | |
class Autogame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define loop(n, i) for(int i=0;i<n;i++) | |
#define all(v) v.begin(),v.end() | |
using namespace std; | |
class Similars | |
{ | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define loop(n, i) for(int i=0;i<n;i++) | |
#define all(v) v.begin(),v.end() | |
using namespace std; | |
class SquareScores | |
{ | |
public: |