Skip to content

Instantly share code, notes, and snippets.

@emcmanus
emcmanus / NSDate+TimeAgoInWords.swift
Created October 3, 2014 22:00
A Swift port of Rails' time_ago_in_words.
//
// NSDate+TimeAgoInWords.swift
//
// A Swift port of Rails' time_ago_in_words.
// Created by Ed McManus for Yardsale on 9/30/14.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

プログレッシブ・エンハンスメントで未来をデザインする

この記事はFrontrend Advent Calendar 2014 - Qiita 10日目の記事です。

プログレッシブ・エンハンスメントは単にJavaScriptをオフにしているユーザのサポートをするか、否かという意味ではありません。
(ちなみに、Gov.ukによると1.1%のユーザはJavaScriptを利用していない、もしくは利用できないという調査結果となっています)
もちろん、古いブラウザに対するアプローチだけでもありません。

デスクトップ、ラップトップ、スマートフォンやタブレット、そしてスマートウォッチなど、今では多くのデバイスにブラウザが搭載されています。

@hokaccha
hokaccha / app.js
Created November 10, 2011 10:58
express mapRouter
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'
@kawamoto
kawamoto / devise.ja.yml
Last active December 12, 2015 06:28 — forked from orzccc/devise.ja.yml
Japanese locale file for "Devise" (2.2) http://github.com/plataformatec/devise/wiki/I18n
#SOURCE https://gist.github.com/orzccc/3104030
ja:
devise:
confirmations:
confirmed: 'アカウントを登録しました。'
# confirmed: 'Your account was successfully confirmed. You are now signed in.'
send_instructions: '登録方法を数分以内にメールでご連絡します。'
# send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
send_paranoid_instructions: 'もしあなたのEメールアドレスが見つかった場合、本人確認についてのメールが数分以内に送られます。'
@manuelvanrijn
manuelvanrijn / chrome-sass-source-maps.md
Created April 4, 2013 06:29
Enable SASS support for your Rails project within chrome using source maps
  1. Goto chrome://flags and enable Enable Developer Tools experiments
  2. Open de Developer toolbar and goto the General tab within settings. Check the Enable source maps
  3. Restart chrome
  4. Open de Developer toolbar and goto the Expirements tab. Check "Support for Sass"

Add the following to your config/environments/development.rb

config.assets.debug = true
config.sass.debug_info = true
# each_with_objectの使い方
# ----------------------------------------
# 1. 簡単な使い方
each_with_objectは、引数のメモ化用オブジェクトを渡して、最後に必ず返す。
alpha_1 = []
('a'..'z').each do |str|
alpha_1 << str.upcase
@aoi0308
aoi0308 / fact.js
Last active December 20, 2015 17:58
JavaScriptでYコンビネータ。 fact.jsはそれを使って定義した関数。
function fact(n) {
return Y(fact0)(n);
}
document.write(fact(6));
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
Have you focused specifically on improving your JS skills at any time in the last year?,Which resources did you use to help you learn?,"Of the resources you used, which kind was the MOST helpful?","Of the resources you used, which kind was the LEAST helpful?","During your learning, which areas have been particularly challenging?",What one resource would you recommend to someone trying to learn JS?,Why do you recommend it?,What one resource would you NOT recommend to someone trying to learn JS?,Why do you NOT recommend it?,Which technologies do you use in your current role?,How long have you been working professionally in web development?,How would you rate the improvement of your JS skills in the last year?,"Have you gotten a new job, a promotion, or new responsibilities since improving your JS skills?",Do you consider yourself a minority in tech?
Yes,"Online courses, Blogs, Books, Help from friends, Help from coworkers, Meetups, Conferences",Help from coworkers,Books,"Debugging, Understanding how to apply th

いかにして我々はフロントエンドに秩序をもたらそうとしてきたか

@mizchi / Quipper

最初に

  • 人間性捧げすぎて資料作るの忘れてました

@nicolashery
nicolashery / gulpfile-react-jshint.js
Created October 20, 2014 17:06
Gulpfile for JSHint on a React app with watch, JSX error logging, and cache
var gulp = require('gulp');
var react = require('gulp-react');
var jshint = require('gulp-jshint');
var cache = require('gulp-cached');
var jsFiles = [
'src/**/*.js',
'test/**/*.js',
'*.js'
];