Skip to content

Instantly share code, notes, and snippets.

Svitlana Moiseyenko svetlanama

Block or report user

Report or block svetlanama

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:fa09d31df68ab0c4d5fe942954b8f818
var tabookey = require('tabookey-gasless');
// step0
const gasPricePercent = 20
relay_client_config = {
txfee: 12,
force_gasPrice: 2000000000, //override requested gas price
force_gasLimit: 4000029, //override requested gas limit.
verbose: process.env.DEBUG
}
View OperationQueue
var testQueue: OperationQueue = {
var queue = OperationQueue()
queue.name = "Test queue"
queue.maxConcurrentOperationCount = 1
return queue
}()
for i in 0...200 {
View UIAnimatedTitleView
import Foundation
import UIKit
class UIAnimatedTitleView: UIView {
private var label = UILabel()
var text: String = "" {
didSet {
label.text = text
label.textColor = UIColor.black
@svetlanama
svetlanama / gist:9201b11dfc7ed7df1d2e1ebdb5580667
Created Dec 10, 2017
Return completionCallback after completing internal callbacks
View gist:9201b11dfc7ed7df1d2e1ebdb5580667
private func initView(completionCallback: (() -> ())? = nil) {
var callbacksLeft = 2
func checkCompleted() {
callbacksLeft -= 1
if callbacksLeft == 0 {
completionCallback?()
}
}
@svetlanama
svetlanama / output.xml
Created Feb 11, 2017
StanfordCoreNLP ganerated .xml of Annotation
View output.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
<document>
<sentences>
<sentence id="1">
<tokens>
<token id="1">
<word>Quantum</word>
<lemma>Quantum</lemma>
View float_point_values_computation.playground
import UIKit
let a = 1e+30
let b = -1e+30
let c = 1.0
let sum1 = (a + b) + c
let sum2 = a + (b + c)
//Representation of floating point value according to IEEE 754
View string_replacing.txt
// Apply mask to credit card number
func applyMask(number: String) -> String {
let mask = "%2A%2A%2A+%2A%2A%2A%2A+%2A%2A%2A%2A+"
let startIndex = number.startIndex
let range = startIndex.advancedBy(1) ..< number.endIndex.advancedBy(-4)
let substring = number.substringWithRange(range)
let replacedWithMask = number.stringByReplacingOccurrencesOfString(substring, withString: mask)
return replacedWithMask
@svetlanama
svetlanama / GrowingSpeed.playground
Last active May 23, 2016
To define which function works faster log or sqrt is to observe their growing speed
View GrowingSpeed.playground
import UIKit
import Foundation
/*
How to define which function works faster log or sqrt
The best way is to caclulate their growing
*/
//Define the growing of function logarithm
func logWithBase(base: Double, n: Double) -> Double {
You can’t perform that action at this time.