Skip to content

Instantly share code, notes, and snippets.

View cawabunga's full-sized avatar
:shipit:

Emil Ibatullin cawabunga

:shipit:
View GitHub Profile
@cawabunga
cawabunga / clientsidescripts.js
Created October 7, 2014 16:03
Protractor Long polling fix (author fedenunez)
clientSideScripts.waitForAngular = function() {
var selector = arguments[0];
var callback = arguments[1];
var TIMEOUT_MS = 18000; // ms
var INTERVAL_MS = 5; //ms
var elapsed = 0;
var el = document.querySelector(selector);
// "inject" $rootScope service
var $rootScope = angular.element(el).injector().get('$rootScope');
@cawabunga
cawabunga / dir.js
Last active December 24, 2015 15:56
WebStorm Live Template: Exports Angular Directive
'use strict';
function factory(ng) {
/**
* @ngdoc directive
* @name $NAME$
* @restrict E
* @scope
*/
# -*- coding: utf-8 -*-
"""
Created on Tue May 5 00:38:34 2020
@author: RIbatullin
"""
def squeeze():
from tkinter.filedialog import askdirectory
@cawabunga
cawabunga / new-line-render-plugin.ts
Last active May 20, 2021 13:13
Replace new lines with <br /> in slate.js
import React from 'react';
import type { SlatePlugin } from '@udecode/slate-plugins-core';
const NEW_LINE = '\n';
const NEW_LINE_ENCODED = encodeURIComponent(NEW_LINE);
const NEW_LINE_ENCODED_TWICE = encodeURIComponent(NEW_LINE_ENCODED);
export const createNewLineRenderPlugin = (): SlatePlugin => ({
renderLeaf: (editor) => ({ children, leaf }) => {
if (typeof children === 'string' && leaf.text.includes(NEW_LINE)) {
@cawabunga
cawabunga / mumbai.log
Last active May 26, 2022 16:40
Bancor Deployment Log
deploying SmartToken as BNT
deploying "BNT" (tx: 0xe8dac03b8720c8a74a18fabd0d5f4a6bb7d86eed9be3ac45d3d71194fae350de)...: deployed at 0x3113907250B45AbB800166E1db7D8eE868cF00FD with 1161208 gas
deploying TokenGovernance as BNTGovernance
deploying "BNTGovernance" (tx: 0xd045571b986e4fc91e08c12032627d52533402427adf1ec8c8cde1786bfd6227)...: deployed at 0x9c987cCFB86Ec44e8B1AE583c8F1456102b69569 with 806794 gas
executing BNTGovernance.grantRole (tx: 0xa8f9acd0078d6a53b91d3a3d55a01cd71a948a77e9bd9282ce8bbd862cfb51dd) ...: performed with 27297 gas
executing BNTGovernance.grantRole (tx: 0xcb42d90036cb6c2f3f7af5a5cc1908b8f8bb7ad48e1bc7462c5f0c95447eae69) ...: performed with 95730 gas
executing BNT.transferOwnership (tx: 0x38a3d028860c0c1698760176406021eccb7c292c9aa83f1dce8ad4b06ee33fd6) ...: performed with 46675 gas
executing BNTGovernance.acceptTokenOwnership (tx: 0xd1eb6de6514a1232cb71dd522125e6ee42d12b4a4177f49450a18dfa6d4a319a) ...: performed with 34070 gas
executing BNTGovernance.grantRole (tx: 0x696147e44e61256a