Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View akouryy's full-sized avatar
💭
🐰

akouryy akouryy

💭
🐰
View GitHub Profile
document.addEventListener("DOMContentLoaded", function() {
var style = document.createElement("style"), collapse = "collapse", none = "none";
style.innerHTML = "." + collapse + ">:first-child::after{content:'(click to open/close)';font-size:80%}";
document.head.appendChild(style);
[].forEach.call(document.getElementsByClassName(collapse), function(elem) {
var children = elem.children, cstyle;
if(children.length == 2) {
cstyle = children[1].style;
children[0].style.cursor = "pointer";
テンプレ略
@akouryy
akouryy / template.cpp
Last active December 12, 2015 13:21
競プロ用テンプレート(2015/11/23)
// C++ 11
// Library
#include <bits/stdc++.h>
using namespace std;
// Type Name
#define TMPL template<class T>
#define TMPL2 template<class T, class U>
#define TMPL_A template<class T, class ...U>
use utf8;
use strict;
use Data::Dumper "Dumper";
binmode(STDOUT, ":utf8");
use constant BLOCKS => [
[
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
@akouryy
akouryy / user.css
Last active November 4, 2015 09:04
ふぁぼ(星ではない)
.icon-favorite-color, .is-favorite .icon-favorite-toggle {
color: #f1c933 !important;
}
.sprite {
background-image: url(http://akouryy.net/tweetdeck.png) !important;
}
.stream-item[data-key^=favorite_] .activity-header>.nbfc {
font-size: 0px !important;
Client -> Server
favorite {ids: [Int]}
unfavorite {ids: [Int]}
retweet {ids: [Int]}
Server -> Client
tweet {content: String, url: String, favorited: Bool, id: Int, userName: String, userScreenName: String, userImageURL: String}
@akouryy
akouryy / mark.js
Last active August 29, 2015 14:28
+[]; // 0
![]; // false
!![]; // true
[]._; // undefined
({}) // Object {}
+[]+""; // "0"
![]+""; // "false"
!![]+""; // "true"
[]._+""; // "undefined"
_=-~[$$=![$=!![]+""]+""];_[__=($_=(__=""+{})[-~-~(_$=-~-~_)])+__[_]+(_._+"")[_]+$$[_$]+$[+[]]+$[_]+$[-~_]+$_+$[+[]]+__[_]+$[_]][__]($$[_]+$$[-~_]+$[_$]+$[_]+$[--_]+"("+_+")")()
@akouryy
akouryy / aoj10002.hs
Last active August 29, 2015 14:25
ポイントフリーの練習
-- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=10002
main = getLine >>= putStrLn . unwords . map show . flip map [product, (2*) . sum] . flip ($) . map read . words
def yu; gets.to_i end
class Integer
def yu sym = nil
if sym
yu &sym
elsif block_given?
times.map{|i| yield gets.chomp}
else
times.map{gets.chomp}