Skip to content

Instantly share code, notes, and snippets.

@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@megahirt
megahirt / Docker with XDebug.md
Last active May 17, 2024 13:49
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective

@h3ssan
h3ssan / JetBrains trial reset.md
Last active May 17, 2024 13:48
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@ericmjl
ericmjl / ds-project-organization.md
Last active May 17, 2024 13:48
How to organize your Python data science project

UPDATE: I have baked the ideas in this file inside a Python CLI tool called pyds-cli. Please find it here: https://github.com/ericmjl/pyds-cli

How to organize your Python data science project

Having done a number of data projects over the years, and having seen a number of them up on GitHub, I've come to see that there's a wide range in terms of how "readable" a project is. I'd like to share some practices that I have come to adopt in my projects, which I hope will bring some organization to your projects.

Disclaimer: I'm hoping nobody takes this to be "the definitive guide" to organizing a data project; rather, I hope you, the reader, find useful tips that you can adapt to your own projects.

Disclaimer 2: What I’m writing below is primarily geared towards Python language users. Some ideas may be transferable to other languages; others may not be so. Please feel free to remix whatever you see here!

@Ryanb58
Ryanb58 / install.md
Last active May 17, 2024 13:42
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@samuel-fonseca
samuel-fonseca / bible_books_list.json
Created September 16, 2017 23:34
A JSON list of all the Bible books, the number of chapters, and the number of verses.
{
"books": [
{
"book": "Genesis",
"verses": 1533,
"chapters": 50
},
{
"book": "Exodus",
"verses": 1213,
@gcatlin
gcatlin / core-audio-sine-wave.c
Last active May 17, 2024 13:34
Core Audio sine wave example
// To run:
// clang core-audio-sine-wave.c -framework AudioUnit && ./a.out
#include <AudioUnit/AudioUnit.h>
#define SAMPLE_RATE 48000
#define TONE_FREQUENCY 440
#define M_TAU 2.0 * M_PI
OSStatus RenderSineWave(
void *inRefCon,
@3Kmfi6HP
3Kmfi6HP / tutorial_cn.md
Last active May 17, 2024 13:31
Customize edgetunnel Cloudflare IP tutorial with cloudflare tunnel

background: 使用 fly.io 的日本机器安装 cloudflare tunnel 利用它代理部署了 edgetunnel 的 cloudflare worker 的域名 实现指定使用日本的IP地址。

同时 也可以通过使用指定中转IP 实现使用全球任意地区的cloudflare IP

菜单点击 Access -> Tunnels

2. 选择一个tunnel

@muendelezaji
muendelezaji / bash-to-zsh-hist.py
Created October 5, 2016 14:18 — forked from op/bash-history-to-zsh-history.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@rougier
rougier / fractal-dimension.py
Last active May 17, 2024 13:25
Fractal dimension computing
# -----------------------------------------------------------------------------
# From https://en.wikipedia.org/wiki/Minkowski–Bouligand_dimension:
#
# In fractal geometry, the Minkowski–Bouligand dimension, also known as
# Minkowski dimension or box-counting dimension, is a way of determining the
# fractal dimension of a set S in a Euclidean space Rn, or more generally in a
# metric space (X, d).
# -----------------------------------------------------------------------------
import scipy.misc
import numpy as np