Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Солнце ещё высоко

Le Karasique Karasiq

🤔
Солнце ещё высоко
  • Pyongyang, North Korea
View GitHub Profile
View reset_idea_trial.sh
#!/bin/bash
#https://github.com/PythonicNinja/jetbrains-reset-trial-mac-osx/blob/master/runme.sh
for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine Rider; do
echo "Closing $product"
ps aux | grep -i MacOs/$product | cut -d " " -f 5 | xargs kill -9
echo "Resetting trial period for $product"
echo "removing evaluation key..."
@Karasiq
Karasiq / Test.java
Created Jul 3, 2020
Refined scala calls demo
View Test.java
import com.wavesplatform.account.Address;
import com.wavesplatform.account.KeyPair;
import com.wavesplatform.common.state.ByteStr;
import com.wavesplatform.state.DataEntry;
import com.wavesplatform.transaction.Asset;
import com.wavesplatform.transaction.DataTransaction;
import com.wavesplatform.transaction.Proofs;
import com.wavesplatform.transaction.smart.InvokeScriptTransaction;
import com.wavesplatform.transaction.smart.SetScriptTransaction;
import com.wavesplatform.transaction.transfer.TransferTransaction;
@Karasiq
Karasiq / Test.java
Created Jul 3, 2020
scala waves transactions test
View Test.java
import com.wavesplatform.account.Address;
import com.wavesplatform.account.KeyPair;
import com.wavesplatform.common.state.ByteStr;
import com.wavesplatform.lang.script.Script;
import com.wavesplatform.lang.v1.FunctionHeader;
import com.wavesplatform.lang.v1.compiler.Terms;
import com.wavesplatform.lang.v1.estimator.ScriptEstimator;
import com.wavesplatform.state.DataEntry;
import com.wavesplatform.state.IntegerDataEntry;
import com.wavesplatform.state.StringDataEntry;
@Karasiq
Karasiq / test.java
Created Jul 3, 2020
waves-transactions-test
View test.java
package im.mak.waves.transactions;
import im.mak.waves.crypto.account.PrivateKey;
import im.mak.waves.crypto.account.PublicKey;
import im.mak.waves.crypto.account.Seed;
import im.mak.waves.transactions.common.*;
import im.mak.waves.transactions.invocation.Function;
import im.mak.waves.transactions.invocation.StringArg;
import java.util.ArrayList;
View ExtractWavesUrls.scala
val file = "/Users/user/Downloads/waves.log"
val regex = s"${Regex.quote("http://.wvservices.com:6869")}(/.*)".r.unanchored
val result = Source
.fromFile(file)
.getLines()
.collect { case regex(url) url }
.map(s => "\"" + s + "\"")
.toSet
.mkString(",\n")
println(result)
View MTProtoTest.scala
import scala.io.StdIn
import scala.language.{implicitConversions, postfixOps}
import scodec.bits.ByteVector
import Types.{ReqDHParams, ReqPQ, ResPQ}
import akka.actor.ActorSystem
import akka.stream.scaladsl.Tcp
import akka.stream.ActorMaterializer
import akka.util.ByteString
import scodec.{Codec, DecodeResult}
@Karasiq
Karasiq / Symbols.md
Created Dec 9, 2018 — forked from reactormonk/Symbols.md
Scalaz Symbol Guide
View Symbols.md
Symbol Explanation Hint
\/ Right-leaning Either Split ways, go one way or the other
-\/ Left value of \/ - is on the left side
\/- Right value of \/ - is on the right side
>>= flatMap shove result into
>> flatMap(_ => ..) shove into, but ignore the result
|@| Applicatives into Tuple Scream operator
|+| Append via Monoid + was taken
`> ` fa.map(_ => b)
View ArraySort.scala
import scala.annotation.tailrec
object ArraySort extends App {
val array = Array(23, 4325, 4, 11, 34, 324, 65)
def bubbleSort(array: Array[Int]): Array[Int] = {
def swapElements(array: Array[Int]): Int = {
var swapsCount = 0
for (i 1 until array.length) {
val leftEl = array(i - 1)
View telebot.py
from telethon import TelegramClient, events, sync
import socks, logging, asyncio, abc
api_id = 17349
api_hash = '344583e45741c457fe1862106095a5eb'
proxy = (socks.SOCKS5, 'deimos.public.opennetwork.cc', 1090, True, '577372493', 'Hm2NcWbp')
# proxy = (socks.SOCKS5, 'localhost', 9050)
phone = "+7телефон"
password = "пароль"
View Типичный код на яве.java
private final native public volatile static transient synchronized protected abstract class FactoryFactoryFactoryFacade extends AbstractBuilderIteratorBeanDecoratorInterceptorFactoryFactory implements AbstractFactoryStrategyIteratorProxy, AbstractFactoryFactoryListener {
SingletonDecoratorAdapter singletonDecoratorAdapter = new SingletonDecoratorAdapter();
AbstractFactoryFactorySingletonBuilderProxy abstractFactoryFactorySingletonBuilderProxy = new AbstractFactoryFactorySingletonBuilderProxy();
VisitorBeanSingletonProxyAdvisorBuilderFactoryFactory visitorBeanSingletonProxyAdvisorBuilderFactoryFactory = new VisitorBeanSingletonProxyAdvisorBuilderFactoryFactory();
IteratorListenerBean iteratorListenerBean = new IteratorListenerBean();