Skip to content

Instantly share code, notes, and snippets.

View PreSoichiSumi's full-sized avatar

PreSoichiSumi PreSoichiSumi

  • A web application engineer in Japan.
  • Tokyo, Japan
View GitHub Profile
@zaltoprofen
zaltoprofen / trace-on
Last active September 29, 2016 07:08
#!/bin/bash
if ! which unlimited-blade-works &>/dev/null; then
echo "Farewell. Drown in your ideals and die." >&2
exit 1
fi
candidate=$(unlimited-blade-works --no-bgm --single-action)
while true; do
echo -n "would you like to mkdir \"$candidate\" ? [Y/n]: "
@kenkoooo
kenkoooo / api_document.md
Last active March 7, 2021 17:33
AtCoder 非公式 API ドキュメント
// ==UserScript==
// @name SmartSubmit for AtCoder
// @version 0.200001
// @auther anta
// @description 問題閲覧画面で Ctrl+V をするだけで提出します。yukicoder <http://yukicoder.me/> の機能・コードを元にしています。
// @match http://*.contest.atcoder.jp/*
// @match https://*.contest.atcoder.jp/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_listValues
@tasukujp
tasukujp / jquey_execution.html
Last active October 22, 2015 13:52
jQueryの実行タイミング確認
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>jQuery実行タイミングの確認</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
// パターン1
$(window).load(function() {
alert("これはwindow.loadのタイミングです。");
@orleika
orleika / getIP.js
Created January 25, 2015 13:47
Node.jsでの接続元IPアドレス取得
var getIP = function (req) {
if (req.headers['x-forwarded-for']) {
return req.headers['x-forwarded-for'];
}
if (req.connection && req.connection.remoteAddress) {
return req.connection.remoteAddress;
}
if (req.connection.socket && req.connection.socket.remoteAddress) {
return req.connection.socket.remoteAddress;
}
@zeroows
zeroows / CORSFilter.java
Last active October 4, 2022 11:44
To enable CORS support in Spring MVC 4 - Access-Control-Allow-Origin
package com.alkhodiry.mb.rest.filters;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
@mattmcd
mattmcd / Hello.g4
Last active April 19, 2024 08:04
Simple ANTLR4 grammar example
// define a grammar called Hello
grammar Hello;
r : 'hello' ID;
ID : [a-z]+ ;
WS : [ \t\r\n]+ -> skip ;