Skip to content

Instantly share code, notes, and snippets.

View yusuke's full-sized avatar

Yusuke Yamamoto yusuke

View GitHub Profile
@yusuke
yusuke / gist:8841559
Created February 6, 2014 10:10
sqlite.py
__author__ = 'yusuke'
import sqlite3
con = sqlite3.connect("emp.db")
sql = u"insert into emp values (?)"
con.execute(sql, '\'')
con.commit()
con.close()
__author__ = 'yusuke'
import sqlite3
con = sqlite3.connect("emp.db")
sql = u"insert into emp values (?)"
con.execute(sql, '\'')
con.execute(sql, '\"')
con.commit()
con.close()
/*
* *
* Copyright 2014 Yusuke Yamamoto
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
/*
* Copyright 2007 Yusuke Yamamoto
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2007 Yusuke Yamamoto
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2007 Yusuke Yamamoto
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
import twitter4j.Twitter;
import twitter4j.TwitterFactory;
public class 改行テスト {
public static void main(String[] args) throws Exception{
Twitter t = TwitterFactory.getSingleton();
t.updateStatus("Hello\nworld");
}
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
public class A {
public static void main(String[] args) throws IOException, URISyntaxException {
String content = String.join("\n",Files.readAllLines(Paths.get(A.class.getResource("/a.properties").toURI()), Charset.defaultCharset()));
System.out.println(content);
@yusuke
yusuke / pom.xml
Created July 2, 2014 11:40
ほら!
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
@yusuke
yusuke / gist:4803f7924d6052873cc9
Created August 1, 2014 16:07
記念 8/2 01:07
01:06 ~ $ telnet www.facebook.com 80
Trying 31.13.79.49...
Connected to star.c10r.facebook.com.
Escape character is '^]'.
GET /index.html HTTP/1.0
HTTP/1.1 503 No server is available for the request
Content-Type: text/html; charset=utf-8
Date: Fri, 01 Aug 2014 16:07:06 GMT
Connection: close