Skip to content

Instantly share code, notes, and snippets.

View obedparla's full-sized avatar
👨‍💻
42

Obed Parlapiano obedparla

👨‍💻
42
View GitHub Profile
@lydell
lydell / .gitignore
Last active December 28, 2022 04:33
Minify Elm code
node_modules
@wpscholar
wpscholar / cypress--support--commands.js
Created January 22, 2020 21:12
Cypress setup for conditional WordPress login. (Double dashes in file names should be replaced with slashes)
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
@obedparla
obedparla / clean-kindle-highlights.js
Last active May 14, 2022 14:53
Clean the HTML for the kindle highlights. Make it ready for a blog post with quotation marks and navigation to each header.
// Open the highlights HTML page on your browser and copy this code in the console of the developer tools
// Don't execute part of the script if you want to avoid some of the changes.
// Remove the highlights elements
const highlights = document.querySelectorAll('.m_noteHeading')
for(let highlight of highlights){
highlight.parentNode.removeChild(highlight)
}
// Transform the sectionHeading into h2 elements
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@codediodeio
codediodeio / database.rules.json
Last active June 22, 2024 07:03
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active June 26, 2024 15:54
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@nkbt
nkbt / .eslintrc.js
Last active May 11, 2024 13:03
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@subfuzion
subfuzion / global-gitignore.md
Last active June 12, 2024 15:57
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@yannleretaille
yannleretaille / validate-selectize-fields.js
Last active June 13, 2024 21:38
How to validate selectize.js comboboxes with the jQuery validation plugin
//How to validate selectize.js comboboxes with the jQuery validation plugin
//selectize.js: http://brianreavis.github.io/selectize.js/ (brianreavis/selectize.js)
//http://jqueryvalidation.org (jzaefferer/jquery-validation)
//configure jquery validation
$("#commentForm").validate({
//the default ignore selector is ':hidden', the following selectors restore the default behaviour when using selectize.js
//:hidden:not([class~=selectized]) | selects all hidden elements, but not the original selects/inputs hidden by selectize
//:hidden > .selectized | to restore the behaviour of the default selector, the original selects/inputs are only validated if their parent is visible
//.selectize-control .selectize-input input | this rule is not really necessary, but ensures that the temporary inputs created by selectize on the fly are never validated
@Shelob9
Shelob9 / 1-pods-loop-general-example.php
Last active April 14, 2023 12:23
Pods Looping Examples.
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {