Skip to content

Instantly share code, notes, and snippets.

View aficiomaquinas's full-sized avatar

Víctor González aficiomaquinas

View GitHub Profile
@kevmo314
kevmo314 / why.md
Last active July 30, 2024 18:56
Please stop reinventing JSX

Please stop reinventing JSX

It really grinds my gears when I see this pattern, in particular navigation bars and sidebars seem to attract it:

const navItems = [
  {
    title: 'home',
    link: '/home',
 },
@mlow
mlow / erpnext.sh
Last active April 12, 2025 05:43
Simple ERPNext setup script
#!/bin/bash
# This script helps with getting Frappe/ERPNext running quickly using
# the upstream Compose specifications. Not intended for production.
#
# Usage:
#
# $ git clone https://github.com/frappe/frappe_docker
# $ cd frappe_docker
# $ curl -Lo erpnext.sh <URL to this raw gist>
#
@xlplugins
xlplugins / restore_user_data_on_checkout.php
Created April 15, 2021 14:30
Restore cart data on cartflows checkout
if(function_exists('BWFAN_Core')){
add_filter( 'cartflows_global_checkout_url', 'bwfan_passing_abandoned_args', 9.5, 1 );
if(!function_exists('bwfan_passing_abandoned_args')){
function bwfan_passing_abandoned_args( $link ) {
if ( ! isset( $_GET['bwfan-ab-id'] ) || empty( $_GET['bwfan-ab-id'] ) ) {
return $link;
}
$link = add_query_arg( array( 'bwfan-ab-id' => sanitize_text_field( $_GET['bwfan-ab-id'] ) ), $link );
Description: >
Script to create a SSL certificate, S3 bucket and Cloudfront distribution.
###############################################################################
Parameters:
###############################################################################
DomainName:
Type: String
Description: The domain name.
@xdavidhu
xdavidhu / converter.sh
Last active September 1, 2024 10:56
Converter.sh, a bash script to convert domain lists to resolved IP lists without duplicates
#!/bin/bash
# Converter.sh by @xdavidhu
# This is a script inspired by the Bug Hunter's Methodology 3 by @Jhaddix
# With this script, you can convert domain lists to resolved IP lists without duplicates.
# Usage: ./converter.sh [domain-list-file] [output-file]
echo -e "[+] Converter.sh by @xdavidhu\n"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "[!] Usage: ./converter.sh [domain-list-file] [output-file]"
exit 1
@ajdruff
ajdruff / fix-git-line-endings
Last active March 4, 2025 00:01
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@darth-veitcher
darth-veitcher / bash-pid.md
Created January 8, 2017 22:13
Bash Script PID file locking

Pattern below allows for a bash script to be called via, say, cron and check to see if it is already running.

Useful for things like rsync tasks.

PIDFILE=/var/run/myscriptname.pid

if [ -f $PIDFILE ]
then
 PID=$(cat $PIDFILE)
@onnimonni
onnimonni / extract-site.sh
Created February 10, 2016 13:28
Script to extract wp-content + database of 1 single site out from the network.
#!/usr/bin/env bash
##
# Script for extracting single site from multisite
##
#SETUP
#static
wpdb="DATABASE NAME"
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };