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
console.log("Hello World"); |
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 React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
send() { | |
console.log("Send!"); | |
} | |
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 React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import SendButton from './components/SendButton' | |
class App extends Component { | |
render() { | |
return ( |
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 React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import SendButton from './components/SendButton' | |
import IOTA from 'iota.lib.js' | |
class App extends Component { | |
constructor(props) { |
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
async function signData(data) { | |
// deletes old sig attribute, if existing | |
delete data.sig; | |
// convert obj to json | |
const json = JSON.stringify(data); | |
// load file with private key | |
const file = await util.promisify(fs.readFile)(path.join(privKeyFile)); |
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
async function verifyData(data) { | |
// return false if the object has no signature | |
if (!data.sig) { | |
return false; | |
} | |
else { | |
// save the signature and delite it from the object | |
const signature = data.sig; |
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 converter = require('@iota/converter') | |
converter.trytesToAscii(transaction.signatureMessageFragment) |
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
require 'iota' | |
# With remote PoW | |
client = IOTA::Client.new(provider: 'https://node.iota-tangle.io:14265') | |
# If you use `client.api.attachToTangle` api here, you'll get error saying that attachToTangle command is not allowed | |
# With local pow | |
client = IOTA::Client.new(provider: 'https://node.iota-tangle.io:14265', local_pow: true) | |
# Now you can use `client.api.attachToTangle` api, which will do the proof-of-work on transaction and return the trytes that needs to be broadcasted |
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
# This migration comes from active_storage (originally 20170806125915) | |
class CreateActiveStorageTables < ActiveRecord::Migration[5.2] | |
def change | |
create_table :active_storage_blobs do |t| | |
t.string :key, null: false | |
t.string :filename, null: false | |
t.string :content_type | |
t.text :metadata | |
t.bigint :byte_size, null: false | |
t.string :checksum, null: false |
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
<div class="field"> | |
<%= form.label :image %> | |
<%= form.file_field :image %> | |
</div> |
OlderNewer