Skip to content

Instantly share code, notes, and snippets.

View urakey's full-sized avatar

akey urakey

View GitHub Profile
@2no
2no / list.scss
Created October 6, 2015 01:33
list と map の比較
// SPRITE
//-----------------------------------------------------------------------------
// 変数のグローバル汚染が複数あり
// list の場合、可読性が低い(コメントが無いと、どの値が何に該当するかわからない)
// 並び順を変えると他に影響を及ぼす
$btn-type1: 49px, 49px, -4px, -4px, "type1";
$btn-type2: 49px, 49px, -61px, -4px, "type2";
$btn-type3: 49px, 49px, -4px, -61px, "type3";
//$btn-type4: 49px, 49px, -4px, -61px, "type4";
@tk3fftk
tk3fftk / hubot_google_calendar.coffee
Last active November 19, 2017 23:26
hubotに毎朝予定をお知らせしてもらう
fs = require('fs')
readline = require('readline')
google = require('googleapis')
googleAuth = require('google-auth-library')
calendar = google.calendar('v3')
SCOPES = [ 'https://www.googleapis.com/auth/calendar.readonly' ]
TOKEN_DIR = (process.env.HOME or process.env.HOMEPATH or process.env.USERPROFILE) + '/.credentials/'
TOKEN_PATH = TOKEN_DIR + 'calendar-api-quickstart.json'
# Create an OAuth2 client with the given credentials, and then execute the
@mizchi
mizchi / フロントエンドを楽にするために.md
Last active December 14, 2023 11:57
フロントエンドを楽にするために

フロントエンドを楽にするために

Qiitaを支えたい技術 at 時雨祭

About

  • HN: mizchi
  • Qiitaの方からきました(入社半年たったらしい)
  • Reactオジサンはそろそろ飽きてきた
  • Angularに興味が無いのでこっちにきた
@FromAtom
FromAtom / docomo-dialog-api.coffee
Last active July 17, 2023 02:26
DOCOMOの雑談対話APIを使ってHubotと雑談する。
# Description:
# DOCOMOの雑談APIを利用した雑談
#
# Author:
# FromAtom
getTimeDiffAsMinutes = (old_msec) ->
now = new Date()
old = new Date(old_msec)
diff_msec = now.getTime() - old.getTime()
@shimizukawa
shimizukawa / 202518103-Restricted-Accounts-and-Single-Channel-Guest-FAQ.rst
Last active August 29, 2015 14:02
【Slack FAQ 翻訳】 2014/6/23 制限アカウントとシングルチャンネルゲスト FAQ Restricted Accounts and Single-Channel Guest FAQ
@michaelparenteau
michaelparenteau / config.ru
Last active January 29, 2016 05:55
Basic Auth Middleman & Heroku
# This is a snippet to add to middleman's config.ru file if you want to add basic auth to your middleman app on heroku
# NOTE: you need to stick this above the build script like shown below
use Rack::Auth::Basic, "Restricted Area" do |username, password|
[username, password] == ['username', 'password']
end
# This part below is just what builds the static site. you only need to add lines 4 - 6 above any build command like shown below.
use Rack::TryStatic, :root => "build", :urls => %w[/], :try => ['.html', 'index.html', '/index.html']
@2no
2no / sample.scss
Last active December 17, 2015 18:18
Sass で sprintf。compass なら、config.rb に sprintf.rb の内容を書いておくと使える。
$tmp: "";
.sample1:after{
$tmp: sprintf("%02d,%02d", 1, 2);
content: "#{$tmp}";
}
// 結果:content: "01,02";
$tmp: "";
.sample1:after{
$tmp: sprintf("%.5s", foobar);
@2no
2no / sample.scss
Last active December 17, 2015 16:59
Sass に文字列置換の関数を追加し、更に引数で関数を指定できる様にしてみる
$tmp: "";
.sample:after {
$tmp: str-replace("/_./", "|x|x.upcase.sub!('_', '')", "test_hoge");
content: "#{$tmp}";
}
// 結果:content: "testHoge";
$tmp: "";
.sample2:after{
$tmp: str-replace("_", "", "test_hoge");
@2no
2no / dogrunt.applescript
Last active December 16, 2015 21:29
このスクリプトを AppleScript エディタでアプリケーションとして保存した後、Finder のツールバーにボタンとして置いておく。後は Gruntfile.js があるディレクトリでボタンをクリックすれば自動的にターミナルが立ち上がって grunt コマンドを実行する
tell application "Finder"
set myWin to window 1
set theWin to (quoted form of POSIX path of (target of myWin as alias))
tell application "Terminal"
activate
tell window 1
do script "cd " & theWin & ";grunt"
end tell
end tell
end tell
@2no
2no / Gruntfile.js
Last active December 16, 2015 07:08
grunt.file.write はファイルエンコーディングを指定して保存が可能だが、iconv-lite を使っている関係で SJIS などの保存は出来ない。 別途 iconv をインストールして対応する必要がある。 (ただし、libiconv にパッチをあてないと SJIS-win や EUCJP-win は扱えない)
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
encoding: {
standardSetting: {
toEncoding: 'SJIS'
, files: {
'dest/result.txt': 'src/original.txt'
, 'dest/concat.txt': ['src/concat/*.txt']