Skip to content

Instantly share code, notes, and snippets.

View shinriyo's full-sized avatar

shinriyo shinriyo

View GitHub Profile
pip install xlwings
@shinriyo
shinriyo / model_list.html
Created August 17, 2014 06:28
xadminの、django-xadmin / xadmin / templates / xadmin / views / model_list.htmlの改造。Adminのときはリンク。 https://github.com/sshwsfc/django-xadmin/blob/master/xadmin/templates/xadmin/views/model_list.html
{% extends base_template %}
{% load i18n %}
{% load url from future %}
{% load xadmin_tags %}
{% block extrastyle %}
<style type="text/css">
.btn-toolbar{margin-top: 0;}
#content-block.full-content{margin-left: 0;}
</style>
@shinriyo
shinriyo / UnityScriptKillerEditor.cs
Created June 25, 2014 06:17
Unity用。このファイルはEditorに入れて使う。通常選ぶC#や素晴らしいBooではなく、糞なUnityScriptをうっかり選択して生成しないためのガード的なEditorスクリプト。
using UnityEngine;
using UnityEditor;
using System.Collections;
public class UnityScriptKillerEditor
{
[MenuItem("Assets/Create/Javascript")]
static void KillUnityScript ()
{
Debug.LogError ("UnityScript is fuck!");
@shinriyo
shinriyo / LeanTweenSequence.cs
Last active August 29, 2015 14:02
It is sequence for LeanTween.
using UnityEngine;
using System.Collections;
/// <summary>
/// Lean tween sequence.
/// </summary>
public class LeanTweenSequence
{
/// <summary>
/// Moves the local x.
@shinriyo
shinriyo / downloadDoubleQuateCsvFile.js
Created June 9, 2014 07:22
Google Spread SheetでCSVをダウンロードするためのGoogle Apps Script
function downloadDoubleQuateCsvFile() {
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var maxColumn = ss.getLastColumn();
var maxRow = ss.getLastRow();
var data = ss.getRange(1, 1, maxRow, maxColumn).getValues();
if (data.length > 1) {
var csv = "";
for (var row = 0; row < data.length; row++) {
for (var col = 0; col < data[row].length; col++) {
if (data[row][col].toString().indexOf(",") != - 1) {
@shinriyo
shinriyo / alloy.jmk
Created March 30, 2014 09:18
Alloy&TitaniumでCoffeeScript & Stylus & Jade https://gist.github.com/polidog/5153107 のバグ修正したものに、 http://umi-uyura.hatenablog.com/entry/2013/12/18/011407 を反映し、コードの整理しました。 詳しくはhttp://d.hatena.ne.jp/shinriyo/20140330
task("pre:compile", function (event, logger) {
var wrench = require("wrench"),
fs = require("fs"),
jade = require("jade"),
path = require("path"),
coffee = require("coffee-script"),
stylus = require("stylus"),
style_root = event.dir.styles;
event.alloyConfig.coffee = [];
@shinriyo
shinriyo / LoadingScript.cs
Created January 25, 2014 18:37
C# Unity ナウローディング
using UnityEngine;
using System.Collections;
public class LoadingScript : MonoBehaviour
{
public string word = "NOW LOADING...";
public float height = 30.0f;
public float speed = 160.0f;
public float deltaX = 25.0f;
public float deltaTime = 30.0f;
@shinriyo
shinriyo / date.js
Created January 9, 2014 13:35
残り時刻を出すのに便利そう UnityScript
function Start () {
//var moment:DateTime = new System.DateTime(1999, 1, 13, 3, 57, 32, 11);
var moment:DateTime = new System.DateTime(2014, 1, 9, 22, 7, 32, 11);
Debug.Log(DateTime.Today);
var delta:TimeSpan = DateTime.Now - moment;
Debug.Log(delta);
Debug.Log(DateTime.Now);
var day:int = delta.TotalDays;
if(day > 0)
@shinriyo
shinriyo / TPRegisterController.m
Created January 3, 2014 08:10
TPRegisterController.mの抜けてたonSubmitメソッド 間違ってるかもしれないが。書いた
- (void)onSubmit
{
[SVProgressHUD showWithStatus:NSLocalizedString(@"TPRegistControllerSending", nil) maskType:SVProgressHUDMaskTypeBlack];
// フォーム取得
QEntryElement *email = (QEntryElement *)[self.root elementWithKey:@"email"];
QEntryElement *password = (QEntryElement *)[self.root elementWithKey:@"password"];
QEntryElement *password_confirm = (QEntryElement *)[self.root elementWithKey:@"password_confirm"];
QEntryElement *username = (QEntryElement *)[self.root elementWithKey:@"username"];
if(email.textValue == NULL || password.textValue == NULL || password_confirm.textValue == NULL || username.textValue == NULL ) {
@shinriyo
shinriyo / score.py
Created December 8, 2013 13:38
実際のスコアのコード
# -*- coding:utf-8 -*-
from bottle import route, run
import sys
import hashlib
from datetime import datetime
from pymongo import Connection
from pymongo.errors import ConnectionFailure
secret_key = 'mySecretKey'