Skip to content

Instantly share code, notes, and snippets.

View juliankasimir's full-sized avatar
🏠
Working from home

Julian Kasimir juliankasimir

🏠
Working from home
View GitHub Profile
@juliankasimir
juliankasimir / pre-commit
Created October 4, 2023 07:39
husky git pre commit hook
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# Get current branch name
branch="$(git rev-parse --abbrev-ref HEAD)"
# Prevent pushing to main or develop
if [ "$branch" = "main" ] || [ "$branch" = "develop" ]; then
echo "❌ You can't commit directly to $branch branch"
exit 1
@juliankasimir
juliankasimir / todo-comments.yml
Created July 3, 2023 06:39
.github/workflows/todo-comments.yml
name: Todo Comments
on: [ pull_request ]
jobs:
todo-comments:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
@juliankasimir
juliankasimir / pr-title.yml
Last active July 5, 2023 12:36
.github/workflows/pr-title.yml
name: Validate pull request title
on:
pull_request:
types: [ opened, edited ]
jobs:
validate-pr-title:
name: Validate pull request title
runs-on: ubuntu-latest
pre-commit:
# Get the name of the current branch
currentBranch=$(git rev-parse --abbrev-ref HEAD)
# Check if the current branch is "main" or "master" and reject commit
if [ "$currentBranch" = "main" ] || [ "$currentBranch" = "master" ]; then
echo "ERROR: Commit rejected by Husky pre-commit hook!"
echo "You are about to commit to the \"$currentBranch\" branch!"
echo "Please create a new branch and commit there."
@juliankasimir
juliankasimir / gist:13750016d26330008adca7353cbb9e90
Last active April 27, 2023 12:40
Borlabs Cookie Datenschutz Code
<h3>Ihre Cookie ID</h3>
[borlabs-cookie type="uid"/]
<h3>Cookie Einstellung</h3>
[borlabs-cookie type="btn-cookie-preference" title="Einstellung öffnen" element="link"/]
<h3>Cookie Auflistung</h3>
[borlabs-cookie type="cookie-list"/]
@juliankasimir
juliankasimir / tailwind.scss
Created March 1, 2023 09:25
Adopt or recreate classes Tailwind
// Manual: https://stackoverflow.com/a/72364191/14331711
// Syntax: https://tailwindcss.com/docs/customizing-colors
$bg-blue-900: #004070;
$bg-blue-700: #537AA2;
$bg-blue-300: #C1CCDD;
$bg-blue-50: #EAEDF3;
$white: #FFF;
$black: #000;
// Define Tailwind Colors
{
"files": [
"assets/ts/*.ts"
],
"compilerOptions": {
"allowJs": true,
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": true,
"target": "es6",
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
content: [
'./**/*.php',
'../Resources/**/*.{html,js}',
],
important: true,
safelist: [
'bg-white',
{
"data": {
"slug": "loremipsum",
"siteName": "loremipsum",
"url": "https://loremipsum.de"
},
"settings": {
"isEnv": "production",
"isServer": false
},
@juliankasimir
juliankasimir / gulpfile.js
Last active February 2, 2023 10:28
Gulpfile
/**
* @file This is my gulpfile
* @author Julian Kasimir <info@jolution.de>
* @copyright Jolution 2022
* @version 1.2 - 14.05.2022
* @description Install with:
* npm install gulp-if fs gulp-changed fancy-log gulp-postcss postcss-import gulp-js-import gulp-typescript gulp-eslint gulp-notify gulp-plumber gulp-sourcemaps gulp-htmlmin gulp-nunjucks gulp-webp gulp-dart-sass autoprefixer cssnano files-exist gulp-babel gulp-uglify gulp-rename del gulp-replace gulp-header-comment gulp-preprocess browser-sync minimist @babel/preset-env --save-dev
* npm install tailwindcss @fortawesome/fontawesome-free --save
* Start with:
* gulp --env development