Skip to content

Instantly share code, notes, and snippets.

View eduwass's full-sized avatar
❄️
working remotely

Edu Wass eduwass

❄️
working remotely
View GitHub Profile
@blvz
blvz / gh-deploy-clone.sh
Last active August 23, 2023 23:15
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@MoOx
MoOx / isDblTouchTap.js
Last active April 30, 2023 19:28
Double touch tap workaround for React based on onTouchTap (react-tap-event-plugin)
const dblTouchTapMaxDelay = 300
let latestTouchTap = {
time: 0,
target: null,
}
export default function isDblTouchTap(event) {
const touchTap = {
time: new Date().getTime(),
target: event.currentTarget,
@maxrice
maxrice / wc-hide-coupons-cart-checkout.php
Created January 21, 2014 23:43
WooCommerce - hide the coupon form on the cart or checkout page, but leave coupons enabled for use with plugins like Smart Coupons and URL Coupons
<?php
// hide coupon field on cart page
function hide_coupon_field_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;
@iamntz
iamntz / readme.md
Last active May 17, 2022 16:15
WP CLI wrapper to run commands on all sites in a network

After you install wp-cli:

If you're on Linux:

  1. Install wpmu wrapper: curl https://gist.githubusercontent.com/iamntz/0018e0535d15e00cf012a18486f102ad/raw/wpms.sh -o /usr/local/bin/wpmu
  2. make it executable: chmod +x /usr/local/bin/wpms
  3. Run commands as you'd normally do, using wpms instead, e.g. wpms plugin list

If you're on Windows:

.fc {
direction: ltr;
text-align: left; }
.fc table {
border-collapse: collapse;
border-spacing: 0; }
.fc .btn {
line-height: 1.2em; }
html .fc {
@heyfletch
heyfletch / fd-clear-elementor-cache.php
Last active February 14, 2022 14:14
Clear Elementor Cache After a WP Migrate DB Pro Migration - Must Use Plugin (mu-plugins)
<?php
/*
Plugin Name: FD Clear Elementor Cache After WP Migrate DB Migration
Plugin URI: https://gist.github.com/heyfletch/769c64ad1fab8679032b076433afafd1
Description: Deletes CSS in uploads/elementor/css, which auto-regenerates on pageload. This clears the cache locally and remotely. Must-use plugin (mu-plugin).
Author: Fletcher Digital
Version: 0.1.1
Author URI: https://fletcherdigital.com
*/
@cassus
cassus / Dev platform settings
Created November 1, 2016 14:54
Zapier app to read Activity and Sleep data from FitBit
## Triggers (Bringing data into Zapier)
### Sleep - polling
https://api.fitbit.com/1/user/-/sleep/date/today.json
### Activity - polling
https://api.fitbit.com/1/user/-/activities/list.json?beforeDate=today&sort=desc&limit=10&offset=0
## Scripting API
see script.js
@alekseykulikov
alekseykulikov / github-actions-ranking.md
Last active August 3, 2021 20:53
Github Actions Ranking (June 18, 2020)

Github Actions is a CI/CD platform that gained a lot of popularity recently. I participated in building ⭐️ Lighthouse CI Action and was curious how well it performs.

But Github Marketplace UI shows no ranking information. Essentially, It's a search with random results; at least, I don't understand the order. I couldn't find ⭐️ Lighthouse CI Action in Continuous integration category after browsing 50 available pages (Each page shows 20 results, so it's possible to see only 1000 results, but CI category has 1469 😐).

I decided to build a custom script that crawls all categories and use Github Search (example query) to estimate usa

@eduwass
eduwass / 0. Custom Date Formats in Rails.md
Last active June 7, 2021 22:32
Custom Date Formats in Rails

Custom Date Formats in Rails

Quick guide on printing pretty dates in Rails

#!/usr/bin/env node
const { writeFileSync, readFileSync, unlinkSync } = require('fs')
const package = require('./package.json')
const packageLock = require('./package-lock.json')
const TEMPLATE_GITHUB_REPOSITORY = 'org/template'
const { GITHUB_REPOSITORY } = process.env