Skip to content

Instantly share code, notes, and snippets.

View ohbarye's full-sized avatar

Masato Ohba ohbarye

View GitHub Profile
@ohbarye
ohbarye / GraphDB.java
Created March 12, 2015 14:18
Try GraphDB(Neo4j), TinkerPop
package controllers;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph;
public class GraphDB {
public static void main(String[] args) {
@ohbarye
ohbarye / fitImageToTransparencyCanvas
Created March 12, 2015 15:43
Fit an image to transparency canvas
#!/usr/local/bin/perl
##################
##
## 画像を重ねる
##
## usage: fitImageToTransparencyCanvas.pl src dst width height
##
##################
@ohbarye
ohbarye / JsoupSample.java
Last active August 29, 2015 14:17
Jsoup simple snippet
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
public static void main(String[] args) {
String url = "https://www.openhub.net/p/72/similar_projects";
// 指定URLにアクセスし、レスポンスをparseしてくれる
Document doc = Jsoup.connect(url).get();
@ohbarye
ohbarye / md_to_html.py
Last active August 29, 2015 14:19
Convert a markdown file to HTML file.
import markdown
import codecs
import sys
md = markdown.Markdown()
html_header = '''
<html>
<head>
<link href="github.css" rel="stylesheet"></link>
@ohbarye
ohbarye / todos.js.coffee
Created August 19, 2015 12:41
This is a taken-a-cup-coffee script of Backbone.js' sample app: Todos' script. Refer to http://localtodos.com/.
# Load the application once the DOM is ready, using `jQuery.ready`:
$ ->
# Todo Model
# ----------
# Our basic **Todo** model has `title`, `order`, and `done` attributes.
class Todo extends Backbone.Model
# Default attributes for the todo item.
@ohbarye
ohbarye / ignore_whitespace.js
Created April 23, 2016 11:10
A bookmarklet to use GitHub's ignore white space feature.
javascript:(
function() {
var href = location.href;
if(href.match(/(\?|&)w=1/)) {
href = href.replace(/(\?|&)w=1/, '');
} else if (href.match(/\?/)) {
href = href + "&w=1";
} else {
href = href + "?w=1";
@ohbarye
ohbarye / npm_run_eject.diff
Created November 20, 2016 03:45
Diff by `npm run eject` of create-react-app version 0.6.0
diff --git a/config/env.js b/config/env.js
new file mode 100644
index 0000000..5d0ab7b
--- /dev/null
+++ b/config/env.js
@@ -0,0 +1,28 @@
+// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
+// injected into the application via DefinePlugin in Webpack configuration.
+
+var REACT_APP = /^REACT_APP_/i;
@ohbarye
ohbarye / inquiry_template.mail
Created June 10, 2017 10:47
Property Search
初めまして。%{last_name}(%{last_name_kana})と申します。
このたび引越先を探しておりまして、以下の条件の物件を探しております。
もし可能でしたら、条件に合う物件をご紹介いただけないでしょうか。
メールの添付ファイル等にてデータを送っていただけると助かります。
もし頂いた物件情報に魅力的なものがございましたら
ぜひお伺いさせて頂き、内覧など行えればと考えております。
@ohbarye
ohbarye / sweets_description.md
Last active November 9, 2018 06:43
パティシエのこだわり焼き菓子をオフィスに置きたい方募集!の詳細

Issue

According to some references below, I assume nginx would downgrade strong etags to weak ones when it modifies response content (e.g. gzip compression). But nginx removes strong etags on gzip compression instead of a downgrade.

Step to reproduce