Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐰

akouryy akouryy

💭
🐰
View GitHub Profile
View collapse.js
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 Dec 12, 2015
競プロ用テンプレート(2015/11/23)
View template.cpp
// 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>
View 63.pl
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 Nov 4, 2015
ふぁぼ(星ではない)
View user.css
.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;
View favon websocket
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}
View mark.js
+[]; // 0
![]; // false
!![]; // true
[]._; // undefined
({}) // Object {}
+[]+""; // "0"
![]+""; // "false"
!![]+""; // "true"
[]._+""; // "undefined"
View alert0.js
_=-~[$$=![$=!![]+""]+""];_[__=($_=(__=""+{})[-~-~(_$=-~-~_)])+__[_]+(_._+"")[_]+$$[_$]+$[+[]]+$[_]+$[-~_]+$_+$[+[]]+__[_]+$[_]][__]($$[_]+$$[-~_]+$[_$]+$[_]+$[--_]+"("+_+")")()
@akouryy
akouryy / aoj10002.hs
Last active Aug 29, 2015
ポイントフリーの練習
View aoj10002.hs
-- 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
View input_template.rb
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}