Skip to content

Instantly share code, notes, and snippets.

View astronaughts's full-sized avatar
💡
Working from home

Masahiro Ueno astronaughts

💡
Working from home
  • Chatwork
  • Osaka, Japan
View GitHub Profile
@astronaughts
astronaughts / Preferences.sublime-settings
Created June 8, 2014 07:08
「Sublime Text を 俺色に染める方法 」のセッション内のデモで設定した Settings - User のファイルの中身
{
"color_scheme": "Packages/Theme - Piatto/Piatto Dark.tmTheme",
"draw_white_space": "all",
"font_size": 21,
"ignored_packages":
[
"Vintage"
],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
@astronaughts
astronaughts / gist:10957999
Last active August 29, 2015 13:59
コマンドパレットで Package Control: までを入力済みで開けるキーマップ
[
{
"keys": ["super+alt+p"],
"command": "show_overlay",
"args": {
"overlay": "command_palette",
"text": "Package Control: "
}
}
]
@astronaughts
astronaughts / get_active_project_path.py
Created March 21, 2014 02:36
Get active project root path in Sublime Text
def get_active_project_path():
import os
window = sublime.active_window()
folders = window.folders()
if len(folders) == 1:
return folders[0]
else:
active_view = window.active_view()
active_file_name = active_view.file_name() if active_view else None
if not active_file_name:
-- クエリ文字列から roomid を取得
local roomid = request.query.roomid
-- http.request で ChatWork API で指定したルームにメッセージを送信
local response = http.request {
method = 'POST',
url = 'https://api.chatwork.com/v1/rooms/'..roomid..'/messages',
headers = {
-- ChatWork API の token を指定
['X-ChatWorkToken'] = 'YOUR_TOKEN'
@astronaughts
astronaughts / gist:7941152
Created December 13, 2013 08:02
Sublime Text 2/3 でインストール済みの Packages をコンソールで出力するワンライナー
from __future__ import print_function; import os; packs = [print(pack) for pack in os.listdir(sublime.packages_path())]
@astronaughts
astronaughts / axelf.js
Created December 12, 2013 15:37
from "Beverly Hills Cop"
var baudio = require('baudio'),
b = baudio();
var melody = [
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
var express = require('express')
, mapRouter = require('./express-mapRouter')
, app = express.createServer()
, routesDir = __dirname + '/routes';
// 'GET /' : 'root:index' はこれと同じ
// var root = require('./routes/root');
// app.get('/', root.index);
var routesMap = {
'GET /' : 'root:index'
@astronaughts
astronaughts / .jshintrc
Last active December 15, 2015 17:49
Ti.Developers.meeting vol.6
{
"globals": {
"beforeEach": true,
"afterEach": true,
"describe": true,
"it": true,
"xdescribe": true,
"xit": true,
"expect": true,
"spyOn": true,
@astronaughts
astronaughts / Gruntfile.js
Created March 10, 2013 04:35
Titanium mobile で grunt watch で CoffeeScript をコンパイルする CoffeeScript >> TI_PROJECT/src/**/*.coffee JavaScript >> TI_PROJECT/Resources/**/*.coffee
module.exports = function(grunt) {
grunt.config.init({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['src/**/*.coffee'],
tasks: ['coffee'],
options: {
interrupt: true
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)