Skip to content

Instantly share code, notes, and snippets.

ericmjl /
Last active July 24, 2024 18: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:

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!

U039b /
Last active July 24, 2024 18:48
Fail2Ban mail report
# Weekly Fail2Ban Report
# Be sure to sudo chmod +x to make it executable
# Original script from
LOGFILE="/var/log/custom_fail2ban_report_$(date +%m%d%Y).log"
SUBJECT="$HOSTNAME Weekly Fail2Ban Report"
soheilhy / server.go
Created August 1, 2015 16:41
grpc route guide server + cmux
* Copyright 2015, Google Inc.
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
loilo /
Last active July 24, 2024 18:45
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`

const B = {

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src=""></script>
<link rel="stylesheet" href="resources/css/main.css" />
<script src="resources/js/index.js" defer></script>

Interview Questions


Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.


rponte /
Last active July 24, 2024 18:42
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...


Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

myisaak / Dockerfile
Last active July 24, 2024 18:41
Puppeteer with Alpine inside multi-staged Dockerfile
FROM node:13-alpine as base
LABEL maintainer="Isaak Eriksson <>"
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
RUN apk update && apk add --no-cache --virtual \
AlexMAS / ProcessAsyncHelper.cs
Last active July 24, 2024 18:39
The right way to run external process in .NET (async version)
using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
public static class ProcessAsyncHelper
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout)
var result = new ProcessResult();
Velocet / Unlock-PowerCfg.ps1
Last active July 24, 2024 18:39
Unlock/Unhide all Power Plan Settings/Options on Windows 10/11
#Requires -RunAsAdministrator
# Unlock-PowerCfg - v22.05.11
# Disable "Connected Standby"
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name 'CSEnabled' -Value 0 -Force
# Get Power Settings entries and add/set 'Attributes' to 2 to unhide
$PowerCfg = (Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse).Name -notmatch '\bDefaultPowerSchemeValues|(\\[0-9]|\b255)$'
foreach ($item in $PowerCfg) { Set-ItemProperty -Path $item.Replace('HKEY_LOCAL_MACHINE','HKLM:') -Name 'Attributes' -Value 2 -Force }