This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var FromView = Backbone.View.extend({ | |
| events: { | |
| 'click .save': 'saveImmediately', | |
| 'keyup textarea': 'autoSave' | |
| }, | |
| saveImmediately: function() { | |
| this.model.save(); | |
| }, | |
| autoSave: _.debounce(function() { | |
| this.model.save(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*global module */ | |
| module.exports = function(grunt) { | |
| "use strict"; | |
| grunt.initConfig({ | |
| watch: { | |
| files: ['src/js/*.js'], | |
| tasks: ['jasmine'] | |
| }, | |
| jasmine: { | |
| sigma: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var sigma = function sigma(first, last, func) { | |
| "use strict"; | |
| for(var n=0, i=first; i<=last; i++) { | |
| n += func(i); | |
| } | |
| return n; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*global describe, beforeEach, sigma, it, expect */ | |
| describe("シグマ", function() { | |
| "use strict"; | |
| beforeEach(function() { | |
| var sigma = sigma; | |
| }); | |
| it("加算", function (){ | |
| var res = sigma(-2, 3, function(k) { | |
| return k + 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO prefectures (prefecture_id, 'name') | |
| VALUES | |
| (1, '北海道'), | |
| (2, '青森県'), | |
| (3, '岩手県'), | |
| (4, '宮城県'), | |
| (5, '秋田県'), | |
| (6, '山形県'), | |
| (7, '福島県'), | |
| (8, '茨城県'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE `users` ( | |
| `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
| `username` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | |
| `password` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | |
| `group` INT NOT NULL DEFAULT 1, | |
| `email` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | |
| `last_login` VARCHAR(25) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | |
| `login_hash` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | |
| `profile_fields` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | |
| `created_at` INT(11) UNSIGNED NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env php | |
| <?php | |
| // 連想配列に色の対応を持っておく | |
| $colors = array( | |
| "90" => "レッド", | |
| "01" => "ブルー", | |
| ); | |
| // 第一引数をプロダクトコードとする |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(selector).colorbox({ | |
| className: "app_name", | |
| previous: "<i class=\"icon-chevron-sign-left\"></i>", | |
| next: "<i class=\"icon-chevron-sign-right\"></i>", | |
| close: "<i class=\"icon-remove-sign\"></i>" | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # coding: utf-8 | |
| import csv | |
| import math | |
| i_filepath = 'data/test.csv' | |
| o_filepath = 'data/out.csv' | |
| description_max = 3000 | |
| str_length_max = 255 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #plugin-title.with-banner .vignette { | |
| box-shadow: inset 0 0 50px 4px rgba( 0, 0, 0, 0.2 ), inset 0 -1px 0 rgba( 0, 0, 0, 0.1 ); | |
| } |