Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tyage on github.
  • I am tyage (https://keybase.io/tyage) on keybase.
  • I have a public key ASCIE46VuHTUk0rBH4TPH87aXQOOoPAtkRhs3nZxiAdpbgo

To claim this, I am signing this object:

@tyage
tyage / plaiddrive.md
Last active April 25, 2016 02:25
PlaidCTF 2016 web 450 plaiddrive writeup
@tyage
tyage / check.sh
Last active April 20, 2016 08:52
ZipArchive少し変?
#!/bin/sh
php -v # => PHP 5.5.9-1ubuntu4.14
mkdir -p /tmp/test
touch /tmp/test/foo
php zip.php
unzip -l /tmp/archive.zip
# result: foo -> prefix/oo
# Archive: /tmp/archive.zip
# Length Date Time Name
@tyage
tyage / bar.js
Last active January 25, 2016 07:04
var foo = require('./foo');
if (module && module.exports) {
// for use of require('bar')
module.exports = foo;
} else {
// for use of <script src="bar.js"></script>
window.foo = foo;
}
@tyage
tyage / request
Created December 9, 2015 09:32
slack app for linuxのuseragentとか
GET / HTTP/1.1
Host: mocos.kitchen:1234
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Slack/1.2.6 Chrome/45.0.2454.85 AtomShell/0.34.3 Safari/537.36 Slack_SSB/1.2.6
Referer: http://tyage.net/
Accept-Encoding: gzip, deflate
Accept-Language: en-US
@tyage
tyage / Syntax.md
Last active December 24, 2015 14:40

6.1 Lexical elements

6.1.2 Identifiers

  • identifier:
    • IDENTIFIER

6.1.3 Constants

  • constant:
@tyage
tyage / ast-gen.rb
Last active November 10, 2015 03:57
asts = %w(translation_unit external_declaration function_definition_list argument_list argument declaration_statement_list declaration_statement statement_list statement parameter_list parameter identifier integer_literal character_literal expression)
%w(compound expression while if for return).each do |statement|
asts.push(statement + '_statement')
end
%w(assign or and comparative additive multiplicative unary postfix function_call primary parentheses).each do |expression|
asts.push(expression + '_expression')
end
http://gyazo.com/6909a21373287f6fa519882d4df29c1e
http://gyazo.com/915346d74f68a560cb4b1ccfbce540b7
http://gyazo.com/41c73f0a286287b1a9492b635a8c961e
http://gyazo.com/6c797d4b1abb1832fd8e4c22094fe5ac
http://gyazo.com/d2c131b4b0360dd15def14c126c316f8
http://gyazo.com/c5c095c482c2bff1c1316e11a34fd90a
http://gyazo.com/41c3a55908902446dfbf2ac69435b724
http://gyazo.com/73f0e3e2f185a9c5155bf325c34f3ba1
http://gyazo.com/d03e0ae1245788b34fa0e370164c1ef6
http://gyazo.com/2ae5ab3a306fb636248d7eeadd977927
import math
f = open('./mandrill.pgm', 'r')
# format
f.readline()
# size
width, height = f.readline().rstrip().split(' ')
# max
max_value = int(f.readline().rstrip())
var questions = [
<div class="question-content">
<p>
<img alt="" src="https://c1.staticflickr.com/9/8594/16054902599_6966b2db21_h.jpg" />
</p>
<p>
<img alt="" src="https://c1.staticflickr.com/9/8569/16646420366_6e0a53ac28_b.jpg" />
</p>
</div>,
<div class="question-content">