Skip to content

Instantly share code, notes, and snippets.

View jfeliweb's full-sized avatar
🖖
Love, Peace and Happiness

Jean Felisme jfeliweb

🖖
Love, Peace and Happiness
View GitHub Profile
@jfeliweb
jfeliweb / git.migrate
Created August 6, 2019 15:42 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@jfeliweb
jfeliweb / repo-reset.md
Created July 18, 2019 15:22 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@jfeliweb
jfeliweb / Docker
Created April 21, 2019 03:23
Node JS and MongoDB in Docker
FROM node:latest
RUN mkdir /app
WORKDIR /app
COPY package.json package.json
RUN npm install
COPY . .
EXPOSE 3000
RUN npm install -g nodemon
CMD [ "nodemon", "app.js"]
@jfeliweb
jfeliweb / cloudSettings
Created December 31, 2018 14:27
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-12-31T14:26:48.256Z","extensionVersion":"v3.2.4"}
@jfeliweb
jfeliweb / Wordpress: Do if the_content is not empty
Created June 28, 2017 22:52 — forked from bhongy/Wordpress: Do if the_content is not empty
Wordpress: Check if the_content is empty / do something only when the_content is empty
<?php
$thecontent = get_the_content();
if(!empty($thecontent)) { ?>
// do or output something
<?php } ?> // break php tag for HTML block
@jfeliweb
jfeliweb / plugin.php
Created June 9, 2017 20:45
PHP7 is slated for release later this year. One of the changes is that PHP4 style constructors are deprecated. In order to prepare WordPress to support PHP7, these constructors have been deprecated in WordPress core. This is a quick guide to all you need to know about this change.
// Deprecating PHP4 style constructors in WordPress 4.3
class My_Widget extends WP_Widget {
function __construct() {
$widget_ops = array( 'classname' => 'css-class', 'description' => 'Description' );
parent::__construct( 'css-class', 'Title', $widget_ops );
}
// Rest of your widget subclass goes here
}
@jfeliweb
jfeliweb / functions.php
Created May 3, 2017 20:57 — forked from tripflex/functions.php
How to remove default company fields from WP Job Manager (this example for Listify)
<?php
// Add your own function to filter the fields
add_filter( 'submit_job_form_fields', 'remove_listify_submit_job_form_fields', 9999999999 );
// This is your function which takes the fields, modifies them, and returns them
// You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/forms/class-wp-job-manager-form-submit-job.php
function remove_listify_submit_job_form_fields( $fields ) {
if( ! isset( $fields['company'] ) ) return $fields;
@jfeliweb
jfeliweb / acf-frontend-post.php
Created September 29, 2016 18:43
Advanced Custom Field form on Front-end
// ======================================================================================
// Codes to put on your page template header
// Remember, the above piece of code needs to be placed between <?php and get_header();
// ======================================================================================
**
* Add required acf_form_head() function to head of page
* @uses Advanced Custom Fields Pro
*/
add_action( 'get_header', 'tsm_do_acf_form_head', 1 );

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream