Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Having fun

Alexander Fallenstedt Fallenstedt

:octocat:
Having fun
View GitHub Profile
@Fallenstedt
Fallenstedt / sync-master.sh
Created Jul 7, 2022
Syncs upstream master with local master
View sync-master.sh
#!/bin/bash
if [ -d ".git" ]; then
echo "git repo detected"
echo "checking out master..."
git checkout master
echo "fetching upstream master..."
git fetch upstream master
echo "merging upstream master to local master..."
git merge upstream/master
@Fallenstedt
Fallenstedt / use-daedalus-socket-cardano-cli.sh
Created Nov 7, 2021 — forked from ilyar/use-daedalus-socket-cardano-cli.sh
Use Daedalus socket for cardano-cli for Mainnet or Testnet the Cardano
View use-daedalus-socket-cardano-cli.sh
#!/usr/bin/env bash
# Install cardano-cli or use docker https://gist.github.com/ilyar/bf4c2346be1a74c50e488181986808fb
#
# Linux https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-linux/latest-finished
# Win64 https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-win64/latest-finished
# Macos https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-macos/latest-finished
# Extcact only cardano-cli into /usr/local/bin/cardano-cli
# Check
cardano-cli --version
@Fallenstedt
Fallenstedt / rest-in-peace.txt
Created Oct 27, 2021
Welcome to the legacy part of the app
View rest-in-peace.txt
_..--""---.
/ ".
` l
|'._ ,._ l/"\
| _J<__/.v._/
\( ,~._,,,,-)
`-\' \`,,j|
\_,____J
.--.__)--(__.--.
/ `-----..--'. j
@Fallenstedt
Fallenstedt / safebuffer.go
Created May 19, 2021 — forked from arkan/safebuffer.go
Golang: Buffer is a goroutine safe bytes.Buffer
View safebuffer.go
package safebuffer
import (
"bytes"
"sync"
)
// Buffer is a goroutine safe bytes.Buffer
type Buffer struct {
buffer bytes.Buffer
@Fallenstedt
Fallenstedt / docker_export_postgre_table.sh
Last active May 17, 2021 — forked from gh0st026/docker_export_postgre_table.sh
Dump PostgreSQL Table in docker container as CSV file
View docker_export_postgre_table.sh
CONTAINER="name"
DB="Db name"
TABLE="Table Name"
FILE="file.csv"
sudo docker exec -u postgres ${CONTAINER} psql -d ${DB} -c "COPY ${TABLE} TO STDOUT WITH CSV HEADER " > ${FILE}
# Copy csv to table
# sudo psql -h localhost -U root -d my_db -p 5432 -c "\COPY source_table TO '/home/user/source_table.csv' DELIMITER ',' CSV HEADER;"
View trafficlight.ino
int switchState = 0;
// pins
const int BUTTON = 2;
const int RED_LED = 3;
const int YELLOW_LED = 4;
const int GREEN_LED = 5;
void setup() {
@Fallenstedt
Fallenstedt / encrypt_decrypt.go
Created Nov 12, 2020
Encrypting and Decrypting in go
View encrypt_decrypt.go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
)
View keybase.md

Keybase proof

I hereby claim:

  • I am fallenstedt on github.
  • I am fallenstedt (https://keybase.io/fallenstedt) on keybase.
  • I have a public key ASC9XKEzj4DsJZDXNeszL8jAlaLxCHhC1esNgTCRlTXaUQo

To claim this, I am signing this object:

View error.txt
[ ] > Task :device_info:preBuild UP-TO-DATE
[ ] > Task :device_info:preDebugBuild UP-TO-DATE
[ ] > Task :device_info:checkDebugManifest UP-TO-DATE
[ ] > Transform firebase-messaging.aar (com.google.firebase:firebase-messaging:20.0.1) with AarTransform
[ ] > Transform firebase-messaging.aar (com.google.firebase:firebase-messaging:20.0.1) with AarTransform
[ ] > Task :device_info:processDebugManifest UP-TO-DATE
[ ] > Task :firebase_analytics:preBuild UP-TO-DATE
[ ] > Task :firebase_analytics:preDebugBuild UP-TO-DATE
[ ] > Task :firebase_analytics:checkDebugManifest UP-TO-DATE
[ ] > Task :firebase_analytics:processDebugManifest UP-TO-DATE
View dayOfWeek.kt
import java.util.*
fun main(args: Array<String>) {
dayOfWeek()
}
fun dayOfWeek() {
println("What day is it today?")
val dayOfWeek: Int = Calendar.getInstance().get(Calendar.DAY_OF_WEEK)