Google App Scriptメモ
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
injector: { | |
options: { | |
// Task-specific options go here. | |
}, | |
scripts: { | |
options: { | |
transform: function(filePath) { | |
filePath = filePath.replace('/app/', ''); | |
filePath = filePath.replace('/.tmp/', ''); | |
return '<script src="' + filePath + '"></script>'; |
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 ary_u8 = new Uint8Array([0x30,0x82,0x06,....]); // byte code | |
var file = new File([ary_u8], 'file name', { | |
lastModified: new Date(0), | |
type: "application/json" | |
}); | |
var dispatchDrop = function(ary_u8){ | |
var createEvent= function(type) { | |
var event = document.createEvent("CustomEvent"); | |
event.initCustomEvent(type, true, true, null); |
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(){ |
ファイル一斉置換
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
// 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; |
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) | |
}); |