Skip to content

Instantly share code, notes, and snippets.

View michaltakac's full-sized avatar
👨‍🏫
https://keybase.io/michaltakac

Michal Takac michaltakac

👨‍🏫
https://keybase.io/michaltakac
View GitHub Profile
@michaltakac
michaltakac / d2q9_bgk_channel_condensed.cpp
Created March 14, 2021 18:00
Condensed D2Q9 BGK Lattice-Boltzmann code written in C++ using ArrayFire
#include <arrayfire.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace af;
int main(int argc, char *argv[]) {
af::info();
const unsigned nx = 1000, ny = 300;
const unsigned total_nodes = nx * ny;
@michaltakac
michaltakac / grid3d.cpp
Last active March 6, 2021 18:20
Representing 3D grid with ArrayFire
#include <arrayfire.h>
#include <math.h>
#include <stdio.h>
using namespace af;
int main(int argc, char *argv[])
{
int nx = 4;
int ny = 3;
@michaltakac
michaltakac / mongodb.js
Created February 10, 2021 11:48
MongoDB connection through mongoose in a Next.js app
import mongoose from "mongoose";
if (!process.env.MONGODB_URI) {
throw new Error("Please define the MONGODB_URI environment variable inside .env.local");
}
/**
* Global is used here to maintain a cached connection across hot reloads
* in development. This prevents connections growing exponentially
* during API Route usage.
@michaltakac
michaltakac / cfd.md
Created November 19, 2020 22:02 — forked from Wumpf/cfd.md
Notes on CFD
@michaltakac
michaltakac / improved-lnd-bitcoind-install.md
Created July 7, 2018 00:14 — forked from bretton/improved-lnd-bitcoind-install.md
updated & improved guide to installing LND, Bitcoind, on Ubuntu 16.04 Server on testnet

2018-03-18: Updating of this guide is taking a backseat to the mainnet version at

Intro

This guide is specific to getting LND and bitcoind running on ubuntu 16.04 LTS for testnet.

It does not address mainnet, or using btcd, or neutrino.

Original installation guide:

Keybase proof

I hereby claim:

  • I am michaltakac on github.
  • I am michaltakac (https://keybase.io/michaltakac) on keybase.
  • I have a public key ASDzhqrolP04w98A9JRjOHOpQuWnqaZIm50UB1-C2mncwQo

To claim this, I am signing this object:

@michaltakac
michaltakac / snippet
Created February 10, 2017 23:26
barthackahton
class componentName extends Component {
constructor(props) {
this.state = {
spotreba: ''
}
}
componentWillMount() {
var self = this;
axios.get(url)
.then(function(response) {
@michaltakac
michaltakac / index.html
Created September 17, 2016 09:57
Loading Cursor in A-Frame
<!-- CURSOR ENTITY -->
<a-entity position="0 1.8 5">
<a-entity
id="camera"
camera
look-controls
rotation="0 0 0"
wasd-controls
>
<!-- MAIN CURSOR -->
@michaltakac
michaltakac / The Technical Interview Cheat Sheet.md
Created April 30, 2016 10:49 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@michaltakac
michaltakac / actionTypeBuilder.js
Last active July 27, 2016 15:07 — forked from dbismut/actionTypeBuilder.js
React Redux Meteor middlewares
export function actionTypeBuilder(prefix) {
return {
type: actionType => `${prefix}/${actionType}`,
loading: actionType => `${actionType}/loading`,
ready: actionType => `${actionType}/ready`,
stopped: actionType => `${actionType}/stopped`,
changed: actionType => `${actionType}/changed`,
error: actionType => `${actionType}/error`,
success: actionType => `${actionType}/success`
};