Skip to content

Instantly share code, notes, and snippets.

View sparkbold's full-sized avatar

Trung Hoang sparkbold

View GitHub Profile
@sparkbold
sparkbold / gw-gravity-forms-map-fields-to-field.php
Created April 22, 2021 13:09 — forked from spivurno/gw-gravity-forms-map-fields-to-field.php
Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
<?php
/**
* Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
*
* Usage
*
* 1 - Enable "Allow field to be populated dynamically" option on field which should be populated.
* 2 - In the "Parameter Name" input, enter the merge tag (or merge tags) of the field whose value whould be populated into this field.
*
* Basic Fields
@sparkbold
sparkbold / .circleci config.yml
Created August 6, 2020 14:00 — forked from ryanshoover/.circleci config.yml
CircleCI 2.1 Continuous Integration with WP Engine
# Continuous Integration to a WP Engine install
# PHP CircleCI 2.1 configuration file
# Requirements:
# 1. In CircleCI settings, add environment variables for your site's installs:
# * WPE_PRODUCTION_INSTALL=thenameofyourproductioninstall
# * WPE_STAGING_INSTALL=thenameofyourstaginginstall
# * WPE_DEVELOPMENT_INSTALL=thenameofyourdevelopmentinstall
# 2. In your repo, have two files
# * `./.gitignores/__default` -- Excludes any compiled files
@sparkbold
sparkbold / git-repo-mirror.md
Created May 15, 2020 12:37 — forked from schmich/git-repo-mirror.md
Mirroring a repo to BitBucket
  1. Create an empty repo in BitBucket
  2. git clone --bare git@github.com:user/repo.git
  3. cd repo.git
  4. git push --mirror git@bitbucket.org:user/repo.git
@sparkbold
sparkbold / delete_git_submodule.md
Created December 9, 2019 17:20 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@sparkbold
sparkbold / delete_git_submodule.md
Created December 9, 2019 17:20 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@sparkbold
sparkbold / .gitignore
Created July 14, 2019 20:37 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@sparkbold
sparkbold / blade-template.php
Created July 11, 2019 00:27 — forked from searleb/blade-template.php
Slick Slider with custom controls and slide indicator
// blade template - just html really
@section('journal-carousel')
<div class="container article-carousel">
<div class="row">
<div class="col-sm-12">
<div class="article-carousel__slider">
@for ($i = 0; $i < 3; $i++)
<figure><img src="{{Theme::url('images/blonde'.$i.'.jpg')}}" alt="" class="img-responsive" /></figure>
@endfor
@for ($i = 0; $i < 3; $i++)
@sparkbold
sparkbold / .md
Created September 22, 2018 20:05 — forked from mbajur/.md
How to create small, unique tokens in Ruby

How to create small, unique tokens in Ruby

That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:

My choice: Dave Bass’s rand().to_s() trick

Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):