Skip to content

Instantly share code, notes, and snippets.

View shinriyo's full-sized avatar

shinriyo shinriyo

View GitHub Profile
@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 / 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 / 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 / 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 / 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>
using UnityEngine;
using System.Collections;
// angleのスピードで、とあるオブジェクトの周りを回転するスクリプト
public class TargetRotation : MonoBehaviour
{
// 変数
// 一秒当たりの回転角度
public float angle = 30f;
@shinriyo
shinriyo / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shinriyo
shinriyo / css_resources.md
Last active August 29, 2015 14:16 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@shinriyo
shinriyo / ScriptableObjectToAsset.cs
Created September 12, 2015 02:48 — forked from tsubaki/ScriptableObjectToAsset.cs
ScriptableObjectをAssetsファイルとして出力する汎用スクリプト
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
/// <summary>
// ScriptableObjectをプレハブとして出力する汎用スクリプト
/// </summary>
// <remarks>
// 指定したScriptableObjectをプレハブに変換する。
var tabGroup = Ti.UI.createTabGroup();
var win1 = Ti.UI.createWindow({
title: "win 1",
backgroundColor: "blue"
});
var data = [
{title:'Album 1', hasChild:true, dest:'album_1.js'},
{title:'Album 2', hasChild:true, dest:'album_2.js'},