Skip to content

Instantly share code, notes, and snippets.

View r-this's full-sized avatar
🌸

R. ロドマン r-this

🌸
View GitHub Profile
@NicolasDurant
NicolasDurant / BaseAlert.vue
Last active August 23, 2023 19:57
[Vue3 / HTML / JS / CSS - Tailwind theme components build in Vue3] This is a whole custom flat design implementation with colors and custom forms, built with tailwind css and Vue3. It contains the necessary tailwind config and css basis, and the implementation of 16! basic design elements like cards, buttons, lists, tables, etc. in Vue3. All com…
<template>
<div v-if="showMe" :class="[`variant-${variant}`]" class="rounded-md p-4">
<div class="flex">
<!-- LEADING ICON -->
<div class="flex-shrink-0 icon">
<CheckCircleIcon v-if="variant === 'success'" class="h-5 w-5" aria-hidden="true"/>
<InformationCircleIcon v-if="variant === 'info'" class="h-5 w-5 text-blue-400" aria-hidden="true"/>
<ExclamationTriangleIcon v-if="variant === 'warn'" class="h-5 w-5" aria-hidden="true"/>
<XCircleIcon v-if="variant === 'error'" class="h-5 w-5" aria-hidden="true"/>
</div>
@jonlabelle
jonlabelle / change_default_git_branch_to_master.md
Last active January 24, 2024 19:48
Change GitHub default branch from master to main.

Change GitHub default branch from master to main

5 simple steps that I tested and used to make the change in under 1 minute.

  1. Move the master branch to main

    git branch --move master main
@NicolasDurant
NicolasDurant / DragDrop.vue
Last active August 25, 2023 00:11
[Vue / Nuxt - Image Drag & Drop or Choose Image] Component that provides an area for the user to drop an image onto. It's restricted to image file types only. As soon as the image is uploaded it will trigger an emit event 'uploaded', which the parent can listen to. Also includes the ChooseImage Component, but without adding another image preview…
<template>
<div
class="d-flex flex-column justify-center align-end"
style="height: 100%; width: 100%"
>
<!-- DRAG & DROP AREA -->
<div
class="drop d-flex flex-column justify-center align-center"
:class="classes"
@dragover.prevent="dragOver"
@Zekfad
Zekfad / conventional-commits.md
Last active July 22, 2024 15:38
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@r-this
r-this / cosmic_latte.md
Last active August 24, 2023 23:47
Cosmic Latte: The Average Color of the Universe
@bswrundquist
bswrundquist / logger.py
Created October 31, 2019 02:04
Simple logging to use inside a module.
import logging
import sys
def global_logger(name):
logging.basicConfig(
stream=sys.stdout,
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(name)s - %(funcName)s - %(message)s",
)
return logging.getLogger(name)
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 22, 2024 05:09
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@tadone
tadone / snippets.py
Created October 16, 2017 14:03
[Logging] Basic logging
# Import module
import logging
# Logging to console
logging.warning('Watch out!') # will print a message to the console
logging.info('I told you so') # will not print anything
>>>WARNING:root:Watch out!
# Logging to a file
logging.basicConfig(filename='example.log',level=logging.DEBUG)