Skip to content

Instantly share code, notes, and snippets.

Avatar

Dimitry Kudryavtsev dk8996

View GitHub Profile
@dk8996
dk8996 / pool-reg-crt.sh
Last active Aug 2, 2020
Makes it easier to create ADA staking pool on ADA network (Shelley 1.18.0)
View pool-reg-crt.sh
#!/bin/bash
#title :pool-reg-crt.sh
#donations :ADA: addr1q832gesdnxn9twyymtqmqywcsutmqc23u6wghr5y44mmyn6dze685vgkuem8hvd3kdej7kpzuzf7wxk3qndrmwjplusq5rr3d6
#description :This script makes it easy to register your pool, see https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/register_stakepool.html.
#author :Dimitry Kudryavtsev (dimitry@mentful.com)
#version :1
#usage :./pool-reg-crt.sh <payment.addr> <payment.skey> <stake.skey> <cold.skey> <pool-registration.cert> <delegation.cert>
#notes :For updates, please look at https://gist.github.com/dk8996/f86100caa74c4afc43e7b7125cff9671
#==============================================================================
@dk8996
dk8996 / simple-transaction.sh
Last active Aug 2, 2020
Script for creating a simple transaction on ADA network (Shelley 1.18.0)
View simple-transaction.sh
#!/bin/bash
#title :simple-transaction.sh
#donations :ADA: addr1q832gesdnxn9twyymtqmqywcsutmqc23u6wghr5y44mmyn6dze685vgkuem8hvd3kdej7kpzuzf7wxk3qndrmwjplusq5rr3d6
#description :This script makes it easy to send a simple transaction from one address to another, see https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/simple_transaction.html.
#author :Dimitry Kudryavtsev (dimitry@mentful.com)
#version :1
#usage :./simple-transaction.sh <File with address of the sending wallet, payment.addr> <File with address of the receiving address payment2.addr> <File with the skey (payment.skey) sending wallet>
#notes :For updates, please look at https://gist.github.com/dk8996/6dc32b3dd8dab6786e6f15d64a18267e
#==============================================================================
@dk8996
dk8996 / Util.java
Last active Aug 29, 2015
Bigrams, Scala vs Java
View Util.java
public class Util {
public static Set < String > toBigramsJava(String s1) {
Set < String > nx = new HashSet < String > ();
for (int i = 0; i < s1.length() - 1; i++) {
char x1 = s1.charAt(i);
char x2 = s1.charAt(i + 1);
String tmp = "" + x1 + x2;
nx.add(tmp);
}
return nx;
@dk8996
dk8996 / codeship-deploy.sh
Last active Aug 29, 2015
Codeship and Stackdriver integration. Send deploy events to Stackdriver.
View codeship-deploy.sh
export DEPLOY_ENV=dev
pip install requests
python ~/src/github.com/<your-path>/deploy-event.py
@dk8996
dk8996 / index.html
Created Jun 18, 2014
Fixed search bar using Bootstrap 3.0
View index.html
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand hidden-xs" href="#">CompAny</a>
<a class="navbar-brand visible-xs" href="#">C</a>
@dk8996
dk8996 / BasicAuthFilter.scala
Last active Mar 11, 2017
Basic Auth Filter for Play Framework
View BasicAuthFilter.scala
import com.typesafe.scalalogging.slf4j.Logging
import sun.misc.BASE64Decoder
import play.api.mvc._
import scala.concurrent.Future
import play.mvc.Results._
import play.api.libs.concurrent.Execution.Implicits.defaultContext
object BasicAuthFilter extends Filter with Logging {
private lazy val unauthResult = Results.Unauthorized.withHeaders(("WWW-Authenticate",
"Basic realm=\"myRealm\""))
@dk8996
dk8996 / HTTPSRedirectFilter.scala
Last active Jun 25, 2017
Play Framework Filter for AWS Elastic Load Balancer (forward HTTP to HTTPS)
View HTTPSRedirectFilter.scala
import com.typesafe.scalalogging.slf4j.Logging
import play.api.mvc._
import scala.concurrent.Future
import play.mvc.Results._
import play.api.libs.concurrent.Execution.Implicits.defaultContext
object HTTPSRedirectFilter extends Filter with Logging {
def apply(nextFilter: (RequestHeader) => Future[SimpleResult])(requestHeader: RequestHeader): Future[SimpleResult] = {
//play uses lower case headers.
@dk8996
dk8996 / example.css
Last active Sep 18, 2018
Gantt chart with external data example
View example.css
html,body,#wrapper {
width: 100%;
height: 100%;
margin: 0px;
}
.chart {
font-family: Arial, sans-serif;
font-size: 12px;
}
@dk8996
dk8996 / example.css
Last active May 31, 2019
D3.js Gantt Chart, example 3
View example.css
html,body,#wrapper {
width: 100%;
height: 100%;
margin: 0px;
}
.chart {
font-family: Arial, sans-serif;
font-size: 12px;
}
@dk8996
dk8996 / example.css
Last active Dec 17, 2015
D3.js Gantt Chart, example 2
View example.css
html,body,#wrapper {
width: 100%;
height: 100%;
margin: 0px;
}
.chart {
font-family: Arial, sans-serif;
font-size: 12px;
}