Skip to content

Instantly share code, notes, and snippets.

View tokuda109's full-sized avatar
🐥
pith pith pith

Tsuyoshi Tokuda tokuda109

🐥
pith pith pith
View GitHub Profile
@jaredstehler
jaredstehler / gist:5067548
Created March 1, 2013 20:33
jshint config file
{
"bitwise": false,
"camelcase": false,
"curly": false,
"eqeqeq": true,
"forin": true,
"immed": true,
"indent": false,
"latedef": true,
"newcap": false,
@BenHall
BenHall / middleware.js
Created April 18, 2013 21:37
Return the response time as a HTTP header in NodeJS
var time = require('./response-time');
app.configure(function(){
app.use(time());
});
@froop
froop / js-template-memo.md
Last active November 13, 2019 04:56
JavaScript テンプレートエンジン vs DOM 直接操作

JavaScript テンプレートエンジン vs DOM 直接操作

Backbone.js とかで JavaScript で MVC してるサンプルとかを読んでいると、 HTML の可変部分はテンプレートエンジンの使用が推奨されているようだが (例: http://backbonejs.org/docs/todos.html )、 サーバー側と違ってクライアント側では DOM 操作ができるので、わざわざテンプレートエンジン使ってテキストベースでやるよりも、 DOM を jQuery で直接操作した方が分かりやすいんじゃないかと思った。

デザイナーが HTML、プログラマー が JavaScript と担当者を分ける場合には便利なのかな。

@Kuniwak
Kuniwak / Promises_A_plus_JP.markdown
Last active December 19, 2015 05:19
JavaScript でスマートに非同期なコードを書くための Promise パターンの仕様(改良版)の邦訳です。

JavaScript でスマートに非同期なコードを書くための Promise パターンの仕様のうち、thenメソッドに関する仕様であるPromises/A+の邦訳です。 お約束の文言ですが、この翻訳は間違ってるかもしれません。ご指摘・ご質問は大歓迎です。

原文(英語)


Promise/A+

この提言はPromises/A 仕様の提言の振る舞いを明確にし、かつ事実上の標準をカバーしつつ曖昧・問題のある部分を除いたものである。

@gregrickaby
gregrickaby / html5-schema.org-markup.html
Last active August 2, 2022 00:05
Proper SCHEMA.ORG markup
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
@shinyaohira
shinyaohira / App States and Multitasking.md
Last active October 5, 2023 07:57
アプリケーションの状態とマルチタスキング

全体的に簡略化し、必要と思われる部分を抜粋しました。

  • Not running

    アプリは起動されていないか、実行されていたけれどもシステムによって終了されています。

  • Inactive

@leommoore
leommoore / linux_running_a_node_service_pm2.md
Last active March 23, 2019 11:29
Linux - Running a Node Service (PM2)
@ismell
ismell / README.md
Last active September 10, 2016 15:39
Docker Ubuntu upstart scripts

Production Ready Process Monitoring

  1. Install docker-manger.conf and docker-instance.conf in /etc/init

  2. Create a containers file in /etc/docker/ with the following format

     name: image cmd
    

    The name must be unique.

  3. sudo service docker-manager start

@pocotan001
pocotan001 / globals.snippets.js
Last active April 29, 2023 15:03
Finding improper JavaScript globals.
// globals.js
// https://gist.github.com/pocotan001/6305714
// Finding improper JavaScript globals
(function() {
var prop, cleanWindow,
globals = new function globals() {},
body = document.body,
iframe = document.createElement('iframe'),
ignore = {
@shinyaohira
shinyaohira / View Controller Programming Guide for iOS.md
Last active July 19, 2023 13:23
iOS View Controllerプログラミングガイド

storyboard上で、initial view controllerから他のview controllerに対してrelationshipを確立します。同様に、それらのview controllerから他のview controllerにrelationshipを確立します。最終的に、storyboard上のほとんど、あるいは全てのview controllerを一つのグラフに接続します。接続されたview controllerが、iOSによっていつインスタンス化されるかは、relationshipのタイプによって決まります。