This file contains 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
# demo.rb | |
ts = (1..5).map do |i| | |
Thread.new do | |
sleep(1) | |
puts "done #{i}" | |
Thread.current.kill if i == 3 | |
rand(1..100) | |
end | |
end |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "../IERC20.sol"; | |
interface IERC20Metadata is IERC20 { | |
function name() external view returns (string memory); | |
function symbol() external view returns (string memory); |
This file contains 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
interface IAccessControl { | |
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); | |
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); | |
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); | |
function hasRole(bytes32 role, address account) external view returns (bool); | |
function getRoleAdmin(bytes32 role) external view returns (bytes32); |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract MopedShop { | |
mapping (address => bool) buyers; | |
uint256 public price = 2 ether; | |
address public owner; | |
address public shopAddress; | |
bool fullyPaid; // false |
This file contains 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
loadLocaleFile(locale) { | |
return import(`@/locales/${locale}.json`) | |
} |
This file contains 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 Vue from 'vue' | |
import VueRouter from 'vue-router' | |
import i18n from '../i18n' | |
function load(component) { | |
// '@' is aliased to src/components | |
return () => import(`@/views/${component}.vue`) | |
} | |
Vue.use(VueRouter) |
This file contains 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
$('.lang-switch').click(function(e) { | |
e.preventDefault(); | |
$.i18n().locale = $(this).data('locale'); | |
update_texts(); | |
}); |
This file contains 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
{ | |
"@metadata": { }, | |
"en": { | |
"appname-title": "Example Application" | |
}, | |
"ru": "ru.yml" | |
} |
This file contains 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
$.i18n().load({ | |
'en': { | |
'appname-title': 'Example Application' | |
}, | |
'ru' : { | |
'appname-title': 'Демонстрационное приложение' | |
} | |
}); |
This file contains 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
<li data-i18n="message-key">Fallback text</li> |
NewerOlder