Skip to content

Instantly share code, notes, and snippets.

View beaussan's full-sized avatar

Nicolas Beaussart beaussan

  • PayFit
  • France
  • 00:27 (UTC +02:00)
  • X @beaussan
View GitHub Profile
@pauloportella
pauloportella / conventional-comments.md
Last active June 5, 2024 20:45
How to setup conventional comments on Github

Conventional comments

Source

You can add all conventional comments Labels to Github as a saved replies by following the following steps:

  1. Go to https://github.com/settings/replies
  2. Open Developer Tools
  3. Copy/Paste above code in JavaScript console
  4. Press enter
@flybayer
flybayer / env.ts
Created September 15, 2020 23:10
zod env validation
// config/env.ts
import assert from "utils/assert"
import * as z from "zod"
assert(typeof window === "undefined",
"The config/env.ts file cannot be used in the browser")
const isProduction = process.env.NODE_ENV === "production"
const isDevelopment = process.env.NODE_ENV === "development"
const isTest = process.env.NODE_ENV === "test"
@zkochan
zkochan / package.json
Last active July 20, 2019 19:22
How to force users of a repository to use pnpm for installation
{
"scripts": {
"preinstall": "node --eval \"!process.env.npm_config_user_agent.startsWith('pnpm/')&&(console.log('Use `pnpm install` to install dependencies in this repository')||true)&&process.exit(1)\""
}
}
@lukasmartinelli
lukasmartinelli / semester_report
Created February 15, 2014 16:43
Calculate the total time based on the summary and time of iCalendar Events
from icalendar import Calendar
from datetime import timedelta
from itertools import groupby
from operator import itemgetter
def calculate_time(event):
start = event['DTSTART'].dt
end = event['DTEND'].dt
return end - start