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
const { app, protocol, BrowserWindow } = require('electron'); | |
const path = require('path'); | |
const url = require('url'); | |
app.whenReady() | |
.then(() => { | |
protocol.registerFileProtocol('asset', (request, callback) => { | |
console.log(request.url); | |
callback({path: path.join(__dirname, url.parse(request.url).path)}); | |
}); |
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
public class LibphonenumberCarrierMappingExample { | |
final static PhoneNumberUtil util = PhoneNumberUtil.getInstance(); | |
final static PhoneNumberToCarrierMapper cmap = PhoneNumberToCarrierMapper.getInstance(); | |
public static void main(String[] argv) | |
{ | |
try { | |
final String numstr = argv[0]; | |
final PhoneNumber number = util.parse(numstr, Locale.JAPAN.getCountry()); |
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
/** | |
* Definition for singly-linked list. | |
* struct ListNode { | |
* int val; | |
* ListNode *next; | |
* ListNode(int x) : val(x), next(NULL) {} | |
* }; | |
*/ | |
class Solution { |
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
Dictionary<string, object> data_alex = new Dictionary<string, object>(); | |
data_alex["NAME"] = "Alex"; | |
data_alex["GENDER"] = "Male"; | |
data_alex["BIRTH"] = new DateTime(1989, 12, 3).Date; | |
data_alex["TODAY"] = DateTime.Today.Date; | |
data_alex["LEVEL"] = 99; | |
Dictionary<string, object> data_steve = new Dictionary<string, object>(); | |
data_steve["NAME"] = "Steve"; | |
data_steve["GENDER"] = "Male"; |
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
/** | |
* | |
* Simple Excel Template Engine v0.8 | |
* Copyright (c)2018 Takuya Sawada <[email protected]> | |
* | |
* This software is released under the MIT License. | |
* http://opensource.org/licenses/mit-license.php | |
* | |
*/ | |
using System; |
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
// Compose Data | |
Dictionary<string, object> data = new Dictionary<string, object>(); | |
data["NAME"] = "Takuya Sawada"; | |
data["GENDER"] = "Male"; | |
data["BIRTH"] = new DateTime(1989, 3, 3).Date; | |
data["TODAY"] = DateTime.Today.Date; | |
data["LEVEL"] = 99; | |
// Render template | |
XLWorkbook workbook = new XLWorkbook(@"C:\Users\takuya\Desktop\template.xlsx"); |
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 | |
# class PlayerInventory { | |
public function onSlotChange($index, $before){ | |
$holder = $this->getHolder(); | |
if($holder instanceof Player and !$holder->spawned){ | |
return; | |
} | |
if($index < $this->getSize()){ | |
parent::onSlotChange($index, $before); | |
}else{ |