Skip to content

Instantly share code, notes, and snippets.

View 4e1e0603's full-sized avatar
🎯
I may be slow to respond.

David Landa 4e1e0603

🎯
I may be slow to respond.
  • Prague, Czech Republic
View GitHub Profile
@neaxi
neaxi / rules_to_problem_solving.md
Created June 5, 2023 08:03
Rules to problem solving

Rules to Problem Solving

(Unknown author)

Rule #1: Don't assume you understand the problem

This is one of the classic mistakes of problem solving - you think you understand what's going on, but you didn't look deep enough or get enough information to really get it. Before starting to solve any problem, be sure you spend some time and be absolutely sure you understand exactly what's going in.

Rule #2: Don't assume that the person who reported the problem understands the problem either

@Integralist
Integralist / handle unknown json data structure.go
Created January 31, 2022 13:58
[Golang handle unknown json data structure] #go #golang #json #marshal #unmarshal
package main
import (
"encoding/json"
"fmt"
"log"
)
func main() {
var (
@jackcviers
jackcviers / Not a nightmare.md
Created March 22, 2021 21:36
Scala isn't a maintenance nightmare

So the hacker news post said my comment was too long. Warning, long, opinionated post:

Scala dev for 10+ years here. Spark is weird. Databricks has a style guide that deliberately chooses not to use scala features that the rest of the community uses, and doesn't follow the same best practices around library and scala major version usage that the rest of the community uses [1]. It's no surprise that the project has trouble interoperating with libraries outside of the spark ecosystem, and is therefore a maintenance problem.

Spark's style and compatibility problems

Scala isn't a maintenance nightmare, but it does attract a lot of newcomers who dive in, don't stick within one of its many ecosystems, get confused, and generally leave a mess, and that is a direct result of the fact that scala is a multi-paradigm, relatively expressive language to the one(s) it is competing with and pulling developers from, and that those developers, for the large part, don't really want to change and think that Scala is just a

@pauloafpjunior
pauloafpjunior / !error-handling.ts
Last active February 15, 2022 06:14
Error handling in TypeScript: an alternative approach
// Value object
class CityName {
static readonly MIN_LEN_NAME: number = 3
static readonly MAX_LEN_NAME: number = 100
private constructor(private _name: string) { }
// Factory method with validation rules
static create(name: string): [CityName, Error] {
@rob-p
rob-p / rust_and_cpp.md
Last active July 5, 2024 20:53
Some thoughts on Rust vs. C++

This is an interesting question, and I think the answer depends on what your primary goal is. Istvan makes good points in favor of straight-forward C (integrated with Python) for building tools that are easy for others, without a ton of experience in programming languages, to modify etc. However, if your primary goal is to make efficient and robust tools for others to use, then let me offer a somewhat different perspective.

The language in which one develops a project has important implications beyond just the speed and memory profiles that will result. Both C++ and Rust will allow you to write very fast tools, making use of zero-cost abstractions where feasible, with predictable and frugal memory profiles (assuming you choose the right algorithms and are careful in designing the programs). However, two important areas where I see these languages diverging are safety and maintainability. By safety, I mean minimizing the types of nefarious memory and correctness bugs that can easily slip into "bare-met

@carboleum
carboleum / kraken.lisp
Last active January 6, 2021 19:30
Access Kraken API with Common Lisp
(ql:quickload :cl-kraken)
(setq cl-kraken/src/globals::*api-key* "my api key")
(setq cl-kraken/src/globals::*api-secret* "my api secret")
; public market data
(cl-kraken::request "Time")
(cl-kraken::request "Ticker" :params '(("pair" . "XXBTZEUR")))
; private user data
(cl-kraken::request "Balance" :post t)
(cl-kraken::request "TradeBalance" :params '(("asset" . "ZEUR")) :post t)
@RobertAKARobin
RobertAKARobin / python.md
Last active June 13, 2024 04:24
Python Is Not A Great Programming Language
@ipudu
ipudu / rename_pdf.py
Created October 4, 2019 01:51
Rename an academic article pdf with human readable format
import sys
import requests
import PyPDF2
import requests
import os
crossref = 'http://api.crossref.org/'
def rename(pdf):
"""Rename an academic article pdf file with human readable format
/// The future of Java:
/// - value classes
/// - all values are objects
/// - universal generics
/// - local-variable type inference
/// - records
/// - reconstructors
/// - sealed types
/// - switch expressions
/// - pattern matching
@elnygren
elnygren / ReasonMLStory.re
Created April 25, 2019 17:22
React Storybook ReasonML
open StoryBook;
let _module = [%bs.raw "module"];
storiesOf("ReasonML Example", _module)
->addDecorator(storyFn =>
<div style={ReactDOMRe.Style.make(~textAlign="center", ~marginTop="50px", ())}>
{storyFn()}
</div>
)