Skip to content

Instantly share code, notes, and snippets.

View drodil's full-sized avatar
💣

Heikki Hellgren drodil

💣
View GitHub Profile
@drodil
drodil / npm-check.sh
Created September 21, 2023 08:12
Run npm-check to all package.json files in monorepo
find . -type f -name 'package.json' -not -path './.git/*' -not -path '*/node_modules/*' -execdir readlink -f {} \; -execdir npm-check \; > deps.log
@drodil
drodil / alphabet.md
Created April 27, 2022 05:48
Programmer's phonetic alphabet

Programmer's phonetic alphabet

Just like NATO phonetic alphabet but using software related words. You can use them to spell out your git commit SHAs or JIRA issue codes.

The alphabet

  • A - Agile
  • B - Build
  • C - Commit
import React from "react";
import { useForm, SubmitHandler } from "react-hook-form";
import { usePutFormMutation } from "../formApi";
import { useDispatch, useSelector } from 'react-redux'
type Inputs = {
name: string,
};
export default function FormPageTwo() {
class Session {
public String getCustomerName() {
// Some checks and throws exception if session not started
throw new SessionNotStartedException();
}
public static Session getCurrentSession() {
return new Session();
}
}
@drodil
drodil / gist:bce67cddf2a758e686cf68768c647cb4
Last active October 18, 2021 09:02
Optional.orElse failure
class Session {
public String getCustomerName() {
// Some checks and throws exception if session not started
throw new SessionNotStartedException();
}
public static Session getCurrentSession() {
return new Session();
}
}
package main
import (
"fmt"
"os"
"errors"
)
func NewNote(field string) (Note, error) {
inst := Note{}
#include <iostream>
#include <stdexcept>
class Note {
public:
int PublicField;
std::string GetPrivateField() {
return privateField;
}
void SetPrivateField(const std::string& field) {
/// object_pool.hpp
#include <functional>
#include <iostream>
#include <memory>
#include <stack>
#include <tuple>
// Base class for all poolable objects
class PoolableObject {
#include <iostream>
class HiMyNameIs {
public:
void SlimShady() { std::cout << "Hi! My name is (what?)" << std::endl; }
};
void HiMyNameIs() {
std::cout << "My name is who?" << std::endl;
}
find impl/ -iname *.hpp -o -iname *.cpp -o -iname *.h | xargs clang-format -i -style=file