Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* File: PdoApi.php
*
* Using this you can write PDO related code only one line.
* Example
* (new PdoApi('db', 'name', 'pass', 'host'))->exec('select * from table');
*
* @author takayuki.tamura
* @version 1.0.0
@tak1827
tak1827 / ShellExecFromSerch.js
Last active August 29, 2015 14:25
This script is for node.js. Execute shell command form your web browser's search box.
var PORT = 8081;
var net = require('net');
var child_process = require('child_process');
net.createServer(function(socket) {
socket.setEncoding('utf8');
socket.setTimeout(10*60*1000);// 10 minitus
socket.on('data', function(data) {
var cmd = srchCmd(data);// Get shell command
@tak1827
tak1827 / HttpServer.js
Created July 18, 2015 00:51
キャッシュ機能ありの簡易Httpサーバー
// 必要なモジュールの読み込み
var http = require('http');
var fs = require('fs');
var path = require('path');
// Webアプリのpath
var webappPath = '/Users/re795h/Documents/nodeworkspace';
/***********************************
vi app/views/issues/_form.html.erb
***********************************/
<p><label for="issue_tracker_id"><%= l(:field_tracker) %><span class="required"> *</span></label> <%= text_field_tag :issue_tracker_autocomplete, trackers_options_for_select(@issue), {:required => true, :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)"} %><%= f.hidden_field :tracker_id %></p>
$("#issue_status_id").each(function(){
$(this).val($(this).find("option[selected=selected]").val());
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0">
<title>IPFS TodoApp</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css">
</head>
@tak1827
tak1827 / jwt-secp256k1-secp256r1.js
Last active October 9, 2022 19:35
Can not use 'secp256k1' which is common on Crypto Currency to create JWT, Use 'secp256r1'
/* Common variables */
const JWT = require('jsonwebtoken');
// Payload
const payload = {
sub: 'Subject',
iss: 'Issuer',
exp: 1639248876
}
/***********
Discription
*************/
// Name: Takayuki Tamura
/***********
Text field
*************/
function test1(ary) {
#!/bin/sh
# **************************************************
# IPFS Pinning Script
# **************************************************
# arg.1 start index for loop
# arg.2 end index for loop
# **************************************************
# Constants
PINNING_FILE_PATH="./bancor_recent_trading_logs.txt"
@tak1827
tak1827 / ipfs_pinned_check.sh
Last active July 18, 2019 03:34
Ipfs pinned check
#!/bin/sh
# **************************************************
# IPFS Pinning Checker
# **************************************************
# Constants
PINNING_FILE_PATH="./bancor_recent_trading_logs.txt"
PINNED_FILE_PATH="./pinned_list.txt"
PINNED_CHECK_RESULT_PATH="./pinned_check_result.txt"