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
<?php | |
function lock($lockFileName, $fuc) { | |
if(!file_exists($lockFileName)) { | |
file_put_contents($lockFileName, ''); | |
} | |
$lock_fp = fopen($lockFileName ,"w"); | |
flock($lock_fp, LOCK_EX); | |
try { | |
return $fuc(); |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /app/silexsample/ | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /app/silexsample/index.php [L] | |
</IfModule> |
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
class DisplayOutMonitor { | |
constructor(option) { | |
option = option || {} | |
this.document = option.document || document | |
this.interval = option.interval || 100 | |
} | |
/** | |
* @param {string} | |
* @param {(isOut:boolean)=>void} |
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
class DocumentTopPosition { | |
constructor(doc, win) { | |
this.document = doc || document; | |
this.window = win || window; | |
} | |
/** | |
* @returns {number} top position | |
*/ | |
get(element) { |
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
// デフォルトのjarをアーティファクトから削除 | |
configurations.archives.artifacts.with { archives -> | |
def jarArtifact | |
archives.each { | |
if (it.file =~ 'jar') { | |
jarArtifact = it | |
} | |
} | |
println "JAR to delete: ${jarArtifact}" | |
remove(jarArtifact) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function SheetTable(sheetName) { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName); | |
var headers = sheet | |
.getDataRange() | |
.getValues()[0]; | |
var headersIndexMap = headers.reduce(function(memo, key, i){ | |
memo[key] = i; | |
return memo; | |
}, {}); | |
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
function getListFromSheet(sheetName) { | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = spreadsheet.getSheetByName(sheetName); | |
var range = sheet.getDataRange(); | |
var map = range.getValues(); | |
var header = map[0]; | |
var ary = []; | |
for(var row = 1; row < map.length; row++) { | |
var obj = {}; |
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
function createChatworkClient(token) { | |
var header = {'X-ChatWorkToken' : token }; | |
return { | |
postMessage: function(roomId, message) { | |
var url = "https://api.chatwork.com/v2/rooms/" + roomId + "/messages"; | |
var payload = { | |
'body': message | |
}; | |
var options = { | |
'method': 'post', |
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
<?php | |
function basic_auth_custom(Closure $auth) { | |
switch (true) { | |
case !isset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']): | |
case !$auth($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); | |
header('WWW-Authenticate: Basic realm="Enter username and password."'); | |
header('Content-Type: text/plain; charset=utf-8'); | |
die('このページを見るにはログインが必要です'); | |
} | |
} |