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 = require('express')(); | |
const server = require('http').Server(app); | |
const io = require('socket.io')(server); | |
server.listen(80); | |
app.get('/', (req, res) => { | |
res.sendfile(__dirname + '/index.html'); | |
}); |
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
## ~/Pictures/の場合 | |
$ defaults write com.apple.screencapture location ~/Pictures/ | |
## デフォルトに戻す場合 | |
$ defaults delete com.apple.screencapture location | |
## サービス再起動で設定が反映 | |
$ killall SystemUIServer |
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
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
const socket = io.connect('http://localhost'); | |
socket.on('news', (data) => { | |
console.log(data); | |
socket.emit('my other event', { my: 'data' }); | |
}); | |
</script> |
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 | |
/** | |
* CSVローダー | |
* | |
* @param string $csvfile CSVファイルパス | |
* @param string $mode `sjis` ならShift-JISでカンマ区切り、 `utf16` ならUTF-16LEでタブ区切りのCSVを読む。'utf8'なら文字コード変換しないでカンマ区切り。 | |
* @return array ヘッダ列をキーとした配列を返す | |
*/ | |
function get_csv($csvfile, $mode='sjis') | |
{ |
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
@if ($paginator->hasPages()) | |
<ul class="pagination pagination-sm"> | |
{{-- Previous Page Link --}} | |
@if ($paginator->onFirstPage()) | |
<li class="page-item disabled"><span class="page-link">«</span></li> | |
@else | |
<li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li> | |
@endif | |
@if($paginator->currentPage() > 3) |
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
import org.nem.core.crypto.KeyPair; | |
import org.nem.core.model.Address; | |
import org.nem.core.model.NetworkInfos; | |
public class KeyGenerator { | |
public static void main(String[] args) { | |
while (true){ | |
final KeyPair someKey = new KeyPair(); | |
final Address anAddress = Address.fromPublicKey( | |
NetworkInfos.getTestNetworkInfo().getVersion(), |
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
/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/bin/java | |
Private Key: 00a580ee4da2171107a777cade39cb08aa5a8d73da497412a723d968da0dcc51c7 | |
Public Key: 5cb6cab57d249fa651afc88caf9bebd7834c2104093bcf66cb63e9d474331e0e | |
Address: TBJF34U3NI7NOKQPBEQ4TCWQHWG56LXXOEOATEST | |
Process finished with exit code 0 |
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
let nem = require('nem-sdk').default; | |
let endpoint = nem.model.objects.create('endpoint')(nem.model.nodes.defaultTestnet, nem.model.nodes.defaultPort); | |
// From PASSWORD && PRIVATEKEY | |
let common = nem.model.objects.create('common')('PASSWORD', 'PRIVATEKEY'); | |
// To ADDRESS && Volume && MESSAGE | |
let VOLUME = 10; | |
let transferTransaction = nem.model.objects.create('transferTransaction')('ADDRESS', VOLUME, 'MESSAGE'); |
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
{ | |
"innerTransactionHash": {}, | |
"code": 1, | |
"type": 1, | |
"message": "SUCCESS", | |
"transactionHash": { | |
"data": "HASH" | |
} | |
} |
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 | |
namespace App\Http\Resources; | |
use Illuminate\Http\Resources\Json\Resource; | |
class UserResource extends Resource | |
{ | |
/** | |
* リソースを配列へ変換する |
OlderNewer