Skip to content

Instantly share code, notes, and snippets.

View float1251's full-sized avatar

float1251 float1251

View GitHub Profile
@float1251
float1251 / google_drive_uploader.py
Created November 26, 2018 02:14
google driveの指定フォルダにuploadする
from __future__ import print_function
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from googleapiclient.http import MediaFileUpload
# If modifying these scopes, delete the file token.json.
SCOPES = 'https://www.googleapis.com/auth/drive.file'
drive_service = None
@float1251
float1251 / init.vim
Last active September 29, 2018 00:58
nvim設定
"{{{ macかどうかの判定
if has("unix")
let s:uname = system("uname -s")
if s:uname == "Darwin\n"
" Do Mac stuff here
let s:isMac = 1
else
let s:isMac = 0
endif
endif
import os
class ReplaceValue:
"""
Font入れ替えのデータクラス
タプルでやればいらないが、ひとまず作成
"""
def __init__(self, from_name, from_guid, to_name, to_guid):
self.from_name = from_name
@float1251
float1251 / serialize_field.snippet
Created July 12, 2016 00:53
visual studioで使用する、Unity SerializeFieldのsnippet
<CodeSnippet Format="1.0.0">
<Header>
<Title>serialize_field</Title>
<Shortcut>sfield</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<Default>int</Default>
@float1251
float1251 / .vimrc
Last active January 2, 2017 10:26
.vimrc
" {{{ dein.vim
if &compatible
set nocompatible
endif
if version < 740
finish
endif
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
@float1251
float1251 / CMakeLists.txt
Created January 3, 2016 10:40
subdirectoryを使用する際のCMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(hello)
include_directories("${PROJECT_SOURCE_DIR}")
message(----------------------)
message(${PROJECT_SOURCE_DIR})
message(----------------------)
# file(GLOB subdirs
# "${CMAKE_SOURCE_DIR}/src"
@float1251
float1251 / CMakeLists.txt
Created December 29, 2015 13:25
macでbrew install allegroした後のCMakeLists.txt
cmake_minimum_required(VERSION 3.3)
find_package(PkgConfig)
pkg_check_modules(ALLEGRO5 REQUIRED allegro-5)
pkg_check_modules(ALLEGRO_MAIN REQUIRED allegro_main-5.0)
include_directories(${ALLEGRO5_INCLUDE_DIRS})
include_directories(${ALLEGRO_MAIN_INCLUDE_DIRS})
@float1251
float1251 / CustomEditorWindow.cs
Last active December 10, 2015 09:14
UnityEditorでNodeベースのエディターを作る。
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
public class CustomEditorWindow : EditorWindow
{
class NodeData
@float1251
float1251 / main.ts
Last active November 20, 2015 08:45
webglの初期化
let VSHADER_SRC = `void main(){
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
gl_PointSize = 10.0;
}`;
let FSHADER_SRC = `void main(){
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}`;
function main(){
@float1251
float1251 / chatwork.user.js
Created November 18, 2015 02:05
チャットワークの画像をスタンプ風に変換するchrome拡張機能
// 画像の編集ボタンを押すと自動で編集して、送信する
(function(){
if(location.host.search("www.chatwork.com") == -1){
// 他サイトなので処理しない
return
}
// TODO ON,OFF出来るようにする
setInterval(function(){