Skip to content

Instantly share code, notes, and snippets.

@candlerb
candlerb / go-project-layout.md
Last active October 1, 2024 08:33
Suggestions for go project layout

If someone asked me the question "what layout should I use for my Go code repository?", I'd start by asking back "what are you building: an executable, or a library?"

Single executable

Stage 1: single source file

Create a directory named however you want your final executable to be called (e.g. "mycommand"), change into that directory, and create the following files:

@sub-mod
sub-mod / crc_remote_laptop.md
Last active July 9, 2022 12:03
Setup CodeReady Containers on Remote Server and connect from Laptop 4.2

Following steps work for F29 for F31 look here

On the remote host

cat /etc/redhat-release
Fedora release 29 (Twenty Nine)

Install packages

@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@pythoninthegrass
pythoninthegrass / install_mosh_centos7.sh
Created May 25, 2018 23:10
Install mosh on CentOS 7
#!/usr/bin/env bash
# SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/
# ensure running as root
if [[ "$(id -u)" != "0" ]]; then
exec sudo "$0" "$@"
fi
# install mosh
yum install -y epel-release
@bsedat
bsedat / Dockerfile
Last active August 8, 2023 05:56
Elixir Phoenix Umbrella App + Distillery Multistage Docker Build
FROM elixir:1.4.5 as asset-builder-mix-getter
ENV HOME=/opt/app
RUN mix do local.hex --force, local.rebar --force
# Cache elixir deps
COPY config/ $HOME/config/
COPY mix.exs mix.lock $HOME/
COPY apps/myproject_web/mix.exs $HOME/apps/myproject_web/
COPY apps/myproject_web/config/ $HOME/apps/myproject_web/config/
@nicholasjhenry
nicholasjhenry / cheatsheet.md
Last active March 17, 2021 22:22
Absinthe GraphQL Schema Language Cheat Sheet

GraphQL Schema Language Cheat Sheet

The definitive guide to express your GraphQL schema succinctly

A port of a cheat sheet authored by Hafiz Ismail.

What does it look like?

defmodule MyApp.Schema do
 use Absinthe.Schema
@jessejanderson
jessejanderson / intro-to-otp-in-elixir-resources.md
Last active September 27, 2024 08:14
Intro to OTP in Elixir - Resources
@rpdelaney
rpdelaney / crontab.header
Created August 17, 2016 19:17
Useful crontab header
# +--------- Minute (0-59) | Output Dumper: >/dev/null 2>&1
# | +------- Hour (0-23) | Multiple Values Use Commas: 3,12,47
# | | +----- Day Of Month (1-31) | Do every X intervals: */X -> Example: */15 * * * * Is every 15 minutes
# | | | +--- Month (1 -12) | Aliases: @reboot -> Run once at startup; @hourly -> 0 * * * *;
# | | | | +- Day Of Week (0-6) (Sunday = 0) | @daily -> 0 0 * * *; @weekly -> 0 0 * * 0; @monthly ->0 0 1 * *;
# | | | | | | @yearly -> 0 0 1 1 *;
# * * * * * COMMAND
@bugyt
bugyt / ArchCheatSheet.md
Last active November 14, 2024 09:17
ArchLinux Cheat Sheet

ArchLinux Cheat Sheet

Network configuration

  • List network devices
      # ip link
    
  • Enabling and disabling network interfaces
      # ip link set <network interface> up
    

ip link set down

@tlehman
tlehman / boolfail.py
Created September 21, 2015 23:11
Redefine true and false in python
# Python boolean fail
# Or how to redefine True and False and win any argument on the internet!
# Love, @tlehman
from unittest import TestCase
class BoolFail(TestCase):
def test_false(self):
True = False
assert True == False