Skip to content

Instantly share code, notes, and snippets.

View redrambles's full-sized avatar
:octocat:
Tinkering

Ann Cascarano redrambles

:octocat:
Tinkering
View GitHub Profile
@krystalcampioni
krystalcampioni / conventional-commits.sh
Created January 26, 2024 15:52
Enforcing conventional commit messages
# Enforcing Conventional Commits with a Git Hook
# This gist provides instructions on how to set up a `commit-msg`
# Git hook to enforce [conventional commits](http://www.conventionalcommits.org) in your project.
# The `commit-msg` script checks the commit message against a regex pattern to ensure
# it follows the conventional commit format.
# The `text-styles.sh` script is used to colorize the output of the `commit-msg` script for better readability.
# ----- 1. Copy the hook files to .git/hooks -----
# You need to copy the files from <root>/hooks into <root>/.git/hooks when initializing your project.
export default function usePromise(api) {
const [state, dispatch] = useReducer(
(state, action) => {
switch (action.type) {
case 'LOADING':
return { ...state, loading: true }
case 'RESOLVED':
return { ...state, loading: false, response: action.response, error: null }
case 'ERROR':
return { ...state, loading: false, response: null, error: action.error }
@gaearon
gaearon / Classes.js
Created May 27, 2020 17:38
Beneath Classes: Prototypes
class Spiderman {
lookOut() {
alert('My Spider-Sense is tingling.');
}
}
let miles = new Spiderman();
miles.lookOut();
@bradtraversy
bradtraversy / django_deploy.md
Last active July 18, 2024 16:48
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@MatthieuScarset
MatthieuScarset / .lando.yml
Last active January 4, 2024 15:03
Correct settings for XDebug + VSCode + Lando (+3.0)
# Lando version is at least +3.0
name: drupal-nine
recipe: drupal9
services:
appserver:
webroot: web
xdebug: debug
config:
php: .vscode/php.ini
@ZaynahGiti
ZaynahGiti / Famous_female_coders.md
Created November 8, 2016 09:30 — forked from tonkec/Famous_female_coders.md
Famous female coders
<?php
// Didn't want to recreate your class $this->return_message converted to $return_message
$clean_url = 'http://myurl.com';
$return_message = '<p>Saved: ' . $clean_url . '</p>';
// To localize it and be able to pass it a variable, you would use a placeholder like %d or %s (Digit / String)...
# Ignore everything #
**
!wp-content/
wp-content/**
!wp-content/themes/
!wp-content/plugins/
wp-content/themes/**
wp-content/plugins/**
# Add two rules for each Theme or Plugin you want to include:
@joyrexus
joyrexus / README.md
Last active January 21, 2024 21:51 — forked from btoone/curl.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@mculp
mculp / voices.txt
Created December 3, 2014 00:14
List of voices available by the `say` command on OS X
Agnes en_US # Isn't it nice to have a computer that will talk to you?
Albert en_US # I have a frog in my throat. No, I mean a real frog!
Alex en_US # Most people recognize me by my voice.
Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana.
Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst.
Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh en_US # Do not pull the wool over my eyes.
Bells en_US # Time flies when you are having fun.