Skip to content

Instantly share code, notes, and snippets.

View ged1959's full-sized avatar

ged ged1959

  • YOIKA
  • Tokyo, Japan
View GitHub Profile
@ged1959
ged1959 / why_effective_python.md
Last active April 22, 2017 04:46
書籍「Effective Python」について

この本の事例はなぜ特殊なのか?

draft, created: 2017/04/22;

あえて面倒にした?事例

Item 20: Use None and Docstrings to Specify Dynamic default Arguments

@ged1959
ged1959 / fileread.py
Created January 13, 2017 04:19
fileread.py
# coding: utf-8
file = open('test.txt', 'r', encoding='utf-8')
whole_str = file.read()
file.close()
print(whole_str)
'''
最初、「ascii decoding error」が発生。
以下を参考に解決!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ged1959
ged1959 / gist-gadget.xml
Created September 5, 2016 15:04 — forked from omoshetech-t/gist-gadget.xml
Google gadget for embedding Gist.
<?xml version="1.0"?>
<Module>
<ModulePrefs title="Gist">
<Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="id" display_name="Gist ID" required="true" default_value="10683373"/>
<UserPref name="font_size" display_name="Font size (px)" required="true" default_value="12"/>
<UserPref name="line_height" display_name="Line height (px)" required="true" default_value="16"/>
<Content type="html">
<![CDATA[
<div style="line-height:1.3em">
<h2>ブログのhtmlひな形</h2>
入れ子になるが、このサイトの<code style="margin: 0px; background: #f5f5f5; line-height: 1.2em; color: #696969; font-size: 1.05em;"">html</code>。
<pre style="margin:20px;padding:15px;background:#f5f5f5;line-height:1.2em"><code style="margin: 0px; background: #f5f5f5; line-height: 1.2em; color: #696969; font-size: 1.05em;"">
</code></pre>
<h2>このサイトの設定について</h2>
using UnityEngine;
using System.Collections;
public class CreateButton: MonoBehaviour {
public GameObject cube;
//親子関係の設定に使うために、あらかじめ設定。ここから。
private GameObject cubeparent;
private GameObject Cube;
using UnityEngine;
using System.Collections;
public class Cube : MonoBehaviour {
public void OnMouseDown()
{
Destroy(gameObject);
}
}