Skip to content

Instantly share code, notes, and snippets.

View epexa's full-sized avatar

Erlan Sobakin epexa

  • Planet Earth
View GitHub Profile
@epexa
epexa / belarus_landscapes_changed_150_years.html
Last active July 12, 2018 05:35
Как изменились пейзажи Беларуси за 150 лет: воссоздаем места Наполеона Орды https://cdn.rawgit.com/epexa/22edff6436b63f2daf1fa57b825f91e4/raw/belarus_landscapes_changed_150_years.html
<!-- https://nn.by/?c=ar&i=206341&lang=ru original not work -->
<!DOCTYPE html>
<html>
<head>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter47580142 = new Ya.Metrika({
<script src="https://cdn.jsdelivr.net/npm/golos-js@0.7.0/dist/golos.min.js"></script>
<script>
golos.api.getBlogEntries('goloscore', 0, 20, (err, res) => {
console.log(res.length);
console.log(res);
});
let query = {
select_authors: ['goloscore']
};
@epexa
epexa / golos.min.js
Created June 15, 2018 10:10
Golos.js the JavaScript API for Golos blockchain version 0.7.0
!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}(function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(typeof t[e]){case"function":break;case"object":t[e]=function(e){var r=e.slice(1),n=t[e[0]];return function(t,e,i){n.apply(this,[t,e,i].concat(r))}}(t[e]);break;default:t[e]=t[t[e]]}return t}([function(t,e,r){(function(n){"use strict";var i=r(1),o=r(170),s=r(274),a=r(165),u=r(277)(i),f=r(291),c=r(168),l={api:i,auth:o,broadcast:s,config:a,formatter:u,memo:f,utils:c};"undefined"!=typeof window&&(window.golos=l),"undefined"!=typeof n&&(n.golos=l),e=t.exports=l}).call(e,function(){return this}())},function(t,e,r){(function(n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't b
@epexa
epexa / golos_promise.js
Last active April 25, 2018 11:42
Example promise on blockchain Golos
let accounts = ['goloscore'];
golos.api.getAccounts(accounts)
.then(response => {
console.log(response);
})
.catch(error => {
console.error(error);
});
@epexa
epexa / golos_async_await.js
Last active April 25, 2018 11:42
Example async/await on blockchain Golos
const getAccounts = async(accounts) => {
return await golos.api.getAccounts(accounts);
};
getAccounts(['goloscore'])
.then(response => {
console.log(response);
})
.catch(error => {
console.error(error);
@epexa
epexa / theme.js
Last active March 29, 2018 09:19
Change default Bootstrap theme to another free theme
function changeTheme() {
var themes = ['cosmo', 'journal', 'litera', 'lux', 'minty', 'pulse', 'sandstone', 'united'];
var exceptionsThemes = ['cerulean', 'cyborg', 'darkly', 'materia', 'sketchy', 'slate', 'solar', 'spacelab', 'superhero', 'yeti', 'lumen', 'simplex', 'flatly'];
var menus = ['bg-light', 'bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info', 'bg-dark'];
var menus2 = ['navbar-light', 'navbar-dark'];
/*$.getJSON('https://bootswatch.com/api/4.json', function(data) {
var themes = data.themes;*/
var $controls = $('<form class="form-inline" style="position: fixed; bottom: 12px; right: 20px;"><select class="custom-select mb-2 mr-sm-2 mb-sm-0 input-sm" id="select-theme"></select><select class="custom-select mb-2 mr-sm-2 mb-sm-0 input-sm" id="select-menu"></select><select class="custom-select mb-2 mr-sm-2 mb-sm-0 input-sm" id="select-menu2"></select></form>');
$('footer > .container').append($controls);
var $theme = $('link[href$="bootstrap.min.css"]'),
@epexa
epexa / labels.html
Last active April 12, 2018 13:15
Copy labels from GitHub repo to another GitHub repo - https://rawgit.com/epexa/e1e31abcf81dcd983a9f121a2ce5efa0/raw/labels.html
<p><a target="_blank" href="https://github.com/GolosChain/golos/labels">https://github.com/GolosChain/golos/labels</a></p>
<img src="https://user-images.githubusercontent.com/2198826/37715862-27bafb96-2d2e-11e8-9339-b41672a7d540.png">
<p><a target="_blank" href="http://www.dorukdestan.com/github-label-manager/">http://www.dorukdestan.com/github-label-manager/</a></p>
@epexa
epexa / happy_birthday_k0tb9g9m0t.html
Last active March 12, 2018 16:50
Happy birthday k0tb9g9m0t
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.6/typed.min.js" type="text/javascript"></script>
<style>
*{
padding:0;
margin:0;
}
body{
font-family: Consolas,monaco,monospace;
font-size: 100%;
background: #000;
@epexa
epexa / get_transaction.html
Created March 7, 2018 20:36
get_transaction from blockchain Golos on HTML
<script src="https://cdn.jsdelivr.net/npm/golos-js@0.5.30/dist/golos.min.js"></script>
<script>
// switch to testnet
golos.config.set('websocket', 'wss://ws.testnet3.golos.io');
golos.config.set('chain_id', '5876894a41e6361bde2e73278f07340f2eb8b41c2facd29099de9deef6cdb679');
let trx = {
ref_block_num: 49191,
ref_block_prefix: 2024493436
};
@epexa
epexa / sign_and_send_transaction.html
Created March 7, 2018 20:34
signTransaction and getTransaction on blockchain Golos on HTML
<script src="https://wzrd.in/standalone/buffer"></script>
<script src="https://momentjs.com/downloads/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/golos-js@0.5.30/dist/golos.min.js"></script>
<script>
// switch to testnet
golos.config.set('websocket', 'wss://ws.testnet3.golos.io');
golos.config.set('chain_id', '5876894a41e6361bde2e73278f07340f2eb8b41c2facd29099de9deef6cdb679');
// private posting key
let wif = '5J...';