人感センサー
This file contains 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 rgx = /^(25[0-4]|2[0-4][0-9]|[01][0-9][0-9]|[0-9][0-9]|[1-9])$/ | |
Array.apply(null, {length: 256}) | |
.map(Number.call, Number) | |
.forEach(function(v){ | |
if (!rgx.test(v)) console.log(v) | |
}); |
This file contains 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
// use binding-number-only | |
angular.module('myApp') | |
.directive('bindingNumberOnly', [function () { | |
return { | |
require: 'ngModel', | |
restrict: 'A', | |
scope: {}, | |
link: function(scope, element, attrs, ngModelController) { | |
var validNumber = /^[0-9]+$/; | |
var sucessNumber = ngModelController.$modelValue || 0; |
ファイル一斉置換
bef="before"
aft="after"
for fname in *${bef}*; do
mv "$fname" `echo $fname | sed s/$bef/$aft/`;
done
This file contains 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
// Protractor configuration | |
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js | |
'use strict'; | |
var q = require('q'); | |
var fs = require('fs'); | |
var path = require('path'); | |
String.prototype.toCamelCase = function(){ |