Skip to content

Instantly share code, notes, and snippets.

View stanbar's full-sized avatar
👨‍🎓
Researching blockchain-based voting

Stanislaw Baranski stanbar

👨‍🎓
Researching blockchain-based voting
View GitHub Profile
@stanbar
stanbar / SoftKeyboard.java
Last active September 10, 2018 06:30 — forked from felHR85/SoftKeyboard.java
A solution to catch show/hide soft keyboard events in Android http://felhr85.net/2014/05/04/catch-soft-keyboard-showhidden-events-in-android/
/*
* Author: Felipe Herranz (felhr85@gmail.com)
* Contributors:Francesco Verheye (verheye.francesco@gmail.com)
* Israel Dominguez (dominguez.israel@gmail.com)
*/
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import android.os.Handler;
@stanbar
stanbar / blockchain-kotlin.kt
Last active August 24, 2018 19:23
Simple kotlin blockchain implementation demo
import java.math.BigDecimal
import java.math.BigInteger
import java.security.MessageDigest
import java.security.SecureRandom
import java.util.*
import java.util.concurrent.LinkedBlockingDeque
import kotlin.system.measureTimeMillis
val sha256: MessageDigest = MessageDigest.getInstance("SHA-256")
val rand: SecureRandom = SecureRandom.getInstanceStrong()

Keybase proof

I hereby claim:

  • I am stanbar on github.
  • I am stasbar (https://keybase.io/stasbar) on keybase.
  • I have a public key ASDoC0PasUaZgADa88T2Ng0ghE5R8T6C5Dz3gCBqfVIlHwo

To claim this, I am signing this object:

@stanbar
stanbar / install_keybase_rpi.sh
Last active September 15, 2023 00:09
Keybase Raspberry Pi Raspbian installator
echo go get keybase && \
go get github.com/keybase/client/go/keybase && \
echo go build keybase && \
go build -tags production github.com/keybase/client/go/keybase && \
sudo mv keybase /usr/bin/ && \
echo go build kbfsfuse && \
go build -tags production github.com/keybase/client/go/kbfs/kbfsfuse && \
sudo mv kbfsfuse /usr/bin/ && \
@stanbar
stanbar / lab3.cu
Created April 9, 2019 22:50
Lab3 CUDA
/*
Copyright 2017, Paweł Czarnul pawelczarnul@pawelczarnul.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
sealed class AdProvider {
class BrandAdProvider(val name: String, val linkUrl: String, val imageGs: String) : AdProvider() {
val imageRef: StorageReference get() = FirebaseStorage.getInstance().getReferenceFromUrl(imageGs)
}
object AdMobProvider : AdProvider()
fun setupAds(where: String, adMobView: AdView, adBrandBanner: ImageView, firebaseAnalytics : FirebaseAnalytics) {
if (Utils.isProVersion) {
adMobView.hide()
@stanbar
stanbar / createPairProgrammingSession.sh
Last active July 12, 2021 12:24
Tmux pair programming session for multiple linux users
#!/bin/bash
# execute only the first time:
# sudo groupadd pair-programming
# sudo usermod -a -G pair-programming <host username>
# sudo usermod -a -G pair-programming <your peer username>
tmux -S /tmp/sharedtmux new-session -d -s pair-programming && \
sudo chgrp pair-programming /tmp/sharedtmux && \
chmod g+rwx /tmp/sharedtmux
@stanbar
stanbar / ghPagesViaBranch.md
Last active July 13, 2022 13:09
Deploy GH Pages via dedicated branch

Deployment via gh-pages branch

I find this the cleanes and robust approach to deploying website via gh pages. It deploys site through a separate branch called "gh_pages". That approach is a bit more complex but has some advantages:

  • It keeps sources and generated HTML in two different branches
  • It uses the default public folder
  • It keeps the histories of source branch and gh-pages branch fully separated from each other

Preparations

@stanbar
stanbar / maci-v1-trusted-setup-ceremony_attestation.log
Created September 27, 2023 16:04
Attestation for Maci v1 Trusted Setup Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm stanbar-9407590 and I have contributed to the Maci v1 Trusted Setup Ceremony.
The following are my contribution signatures:
Circuit # 1 (processmessages_6-8-2-3)
Contributor # 25
Contribution Hash: 3a293848 b236c1f8 e3841c50 c22b34a1
6db498d8 667c308a 7b9aa51c 1ffc0989
e1071591 ecf182b7 1d31dd53 3f2950d8
f9411ea9 fe2feae0 6c49760b bd1f4d7c