元ネタ : 【JavaScript】ファイル名(拡張子あり)からファイル名(拡張子なし)と拡張子に分割する(正規表現) - Qiita String#match()じゃなくてString#split()でできるとなんかコードの意味的にもスッキリしそう、っていう思いつきで書いてみた。 function splitExt(filename) { return filename.split(/\.(?=[^.]+$)/); } splitExt('img.jpg'); // => [ 'img', 'jpg' ] splitExt('.html'); // => [ '', 'html' ] splitExt('lib.d.ts'); // => [ 'lib.d', 'ts' ] splitExt('abc'); // => [ 'abc' ] 元ネタはString#match()を使っている
標準組み込みオブジェクトArrayコンストラクターArray() コンストラクター静的メソッドArray.from()Array.fromAsync()Array.isArray()Array.of()静的プロパティArray[@@species]インスタンスメソッドArray.prototype[@@iterator]()Array.prototype.at()Array.prototype.concat()Array.prototype.copyWithin()Array.prototype.entries()Array.prototype.every()Array.prototype.fill()Array.prototype.filter()Array.prototype.find()Array.prototype.findIndex()Array.prototype.findLa
javascript-style-guide 常に気をつけたい、JavaScriptへの正しい接し方 View on GitHub Airbnb JavaScript スタイルガイド() { 元文書:https://github.com/airbnb/javascript 常に気をつけたい、JavaScriptへの正しい接し方 Note: this guide assumes you are using Babel, and requires that you use babel-preset-airbnb or the equivalent. It also assumes you are installing shims/polyfills in your app, with airbnb-browser-shims or the equivalent. 注意: このガイドはあなたがB
In this 3 minute tutorial we’ll write a tiny JavaScript function that helps us crop images to various aspect ratios. Super useful for cropping photos before posting to social media timelines or uploading profile pictures as these are often required to be of a certain aspect ratio. In this tutorial we’ll by modifying image data. For example, when a user is about to upload a an image we crop it to a
splice(start) splice(start, deleteCount) splice(start, deleteCount, item1) splice(start, deleteCount, item1, item2) splice(start, deleteCount, item1, item2, /* …, */ itemN) start 配列の変更を始める位置のゼロから始まるインデックスで、整数に変換されます。 インデックスが負の場合、配列の末尾からさかのぼって数えます。 start < 0 の場合、 start + array.length が使用されます。 start < -array.length の場合は 0 が使用されます。 start >= array.length の場合、要素は削除されませんが、メソッドは追加関数として動作し、指定された数だけ要素を追加しま
Open Chrome Open Firefox Open Safari Navigate to STR('site.com') Click STR('Sign In') Type STR({username:}) into STR('username box') STR({username}) is STR('joe') STR({username}) is STR('bob') STR({username}) is STR('mary') Verify success STR({username}) is STR('baduser') Verify error Test Case 1 Test Case 2 Test Case 3 ----------- ----------- ----------- Open Chrome Open Firefox Open Safari Navig
Express+mongooseで RDBのようなAUTO INCREMENTフィールドを実現する mongoose-sequence パッケージをインストール $ npm install --save mongoose-sequence app.js var mongoose = require('mongoose'); const option = { useMongoClient: true, }; mongoose.Promise = global.Promise; mongoose.connect(`mongodb://localhost/nexpress`, option); // スキーマ定義 var Schema = mongoose.Schema; const AutoIncrement = require('mongoose-sequence')(mongoose);
多くのケースでは、WEBシステムでカラーピッカーを実装しようと思うと、グラデーションのパレットから選択するよりも、あらかじめ決められたいくつかのパレットの中から選択させるほうが、ユーザービリティに優れていると思います。 検索しても出てくるのはグラデーションから選択するカラーピッカーばかりなので、絞り込まれた色のパレットからの選択方式のカラーピッカーを調べてみました。 Huebee 惜しいな。デザインのテイストは悪くないですが、実案件ではこんなにパレットの色は必要ないです。ライセンスはMITです。 md-color-picker Angular用のカラーピッカーです。Angular-Materialをベースに作られています。パレットのパターンがいくつもあります。無駄に高機能すぎるので、もっと機能を絞れると嬉しいです。ライセンスはMITです。 Really Simple Color Picke
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く