Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
#coding:utf-8
import os, sys
import json
import requests
from urllib import urlencode
Client_ID = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com"
Client_secret = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
@a2chub
a2chub / gist:4031134
Created November 7, 2012 12:17
#st2jp に参加してプラグイン作ってみた。
import sublime, sublime_plugin
class SelectReverseCommand(sublime_plugin.TextCommand):
def run(self, edit):
for sel in self.view.sel():
if not sel.empty():
cur_str = self.view.substr(sel)[::-1]
print cur_str
self.view.replace(edit, sel, cur_str)
else:
@a2chub
a2chub / file0.txt
Created January 26, 2013 10:57
AngularJSでは、見た目を変更するのはCSSクラスで操作するのデフォ ref: http://qiita.com/items/6f36f9f9f4cbcd225566
<div ng-class='header'>たいとる</div>
# Japanese setting
export LANG=ja_JP.UTF-8
export SHELL=/bin/zsh
umask 022
# Path Setting
path=($HOME/local/bin $HOME/local/X11R6/bin \
/bin /usr/local/bin /usr/bin \
/usr/X11R6/bin /usr/local/mysql/bin /sbin \
)
@a2chub
a2chub / gist:5377665
Last active December 16, 2015 04:29
LOG: go get
% tree
.
├── README.md
├── api
│   ├── api.go
│   └── article
│   ├── article.go
│   ├── controller.go
│   └── model.go
├── main.go
@a2chub
a2chub / file0.js
Created June 3, 2013 08:05
GASからメールを送る際にちゃんと改行する ref: http://qiita.com/atusi/items/2c2ac48083eeac6e153e
function send_mail(body_str) {
var subject_text = "GASよりお知らせ";
Logger.log(body_str.replace("\n", "<br />"));
var send_list = [
"hoge@hoge.com",
"foo@foo.com"
];
var html_str = body_str.replace("\n", "<br />");
for (var i=0; i<send_list.length; i++){
@a2chub
a2chub / python
Created April 15, 2014 08:15
大量のファイルをフォルダーに整理 ref: http://qiita.com/atusi/items/8ecd361faccc4051ded8
#!/usr/bin/env python
#coding:utf-8
import os
import shutil
JPG_FILE_LIST = []
TGT_FILE_TYPE = '*.jpg'
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@a2chub
a2chub / designer.html
Created July 14, 2014 11:06
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
#!/usr/bin/env python
#coding:utf-8
key_list = range(10)
val_list = range(10)
val_list.reverse()
print "正解: {0:9, 1:8 ...}"