Skip to content

Instantly share code, notes, and snippets.

View bodrovis's full-sized avatar
🐱
I are serious. You now step into my profile.

Elijah S. Krukowski bodrovis

🐱
I are serious. You now step into my profile.
View GitHub Profile
# 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
@bodrovis
bodrovis / ERC.sol
Last active January 16, 2023 15:58
// 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);
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);
// 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
loadLocaleFile(locale) {
return import(`@/locales/${locale}.json`)
}
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)
$('.lang-switch').click(function(e) {
e.preventDefault();
$.i18n().locale = $(this).data('locale');
update_texts();
});
{
"@metadata": { },
"en": {
"appname-title": "Example Application"
},
"ru": "ru.yml"
}
$.i18n().load({
'en': {
'appname-title': 'Example Application'
},
'ru' : {
'appname-title': 'Демонстрационное приложение'
}
});
<li data-i18n="message-key">Fallback text</li>