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 / forkedRepoSourceTree.txt
Created May 11, 2016 13:07
Update my forked repo using SourceTree
First, set up the parent repo:
Open your forked repo in SourceTree.
Select Repository -> Repository Settings in the menu bar.
In the Remotes pane, press Add.
Enter any name you like (often upstream or master) and the URL / path to the parent repo.
Press OK, then OK.
Now, to update:
Select Pull in the toolbar.
@jfeliweb
jfeliweb / vagrant_share.txt
Created May 8, 2016 00:38
How to Create a Share
Heads up! You'll need the latest version of Vagrant installed to use this feature.
HTTP
1) Share the active HTTP server in your environment.
Run vagrant login and enter your Atlas by HashiCorp details
Boot a Vagrant environment and verify it's running an HTTP server
Run vagrant share. You're done!
SSH
@jfeliweb
jfeliweb / sequeal_pro_ssh.txt
Created May 8, 2016 00:32
Sequel Pro, when you make a "New Connection"
On Sequel Pro, when you make a "New Connection", use "SSH" tab.
MySQL Host: 127.0.0.1
Username: wordpress
password: wordpress
Port: 3306
SSH Host: 127.0.0.1
SSH User: vagrant
SSH Password: vagrant
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation Mega Menu</title>
<link rel="stylesheet" href="css/app.css" />
<link href="http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" rel="stylesheet">
<script src="bower_components/modernizr/modernizr.js"></script>
</head>
@jfeliweb
jfeliweb / function.php
Created December 14, 2015 14:32
Enqueue Script for WordPress
/* Proper way to enqueue scripts and styles */
function mytheme_custom_scripts(){
// Register and Enqueue a Stylesheet
// get_template_directory_uri will look up parent theme location
wp_register_style( 'name-of-style', get_template_directory_uri() . '/css/custom-style.css');
wp_enqueue_style( 'name-of-style' );
// Register and Enqueue a Script
@jfeliweb
jfeliweb / functions.php
Created December 14, 2015 14:27
ADDING JQUERY SCRIPT TO WORDPRESS
/**
Add the following code: in function.php
That’s it. The jQuery library and my_script.js will now be loaded within the <head></head> area of every page of your WordPress site except the admin pages.
**/
function add_my_script() {
wp_register_script('my_script', home_url() . '/wp-content/themes/mythemename/js/my_script.js', array( 'jquery' ));
wp_enqueue_script('my_script');
}
@jfeliweb
jfeliweb / style.css
Created July 8, 2015 21:01
Move the admin bar to the left side like a sidebar.
/** Turn it on its side (sidebar) **/
/* WordPress Admin Bar Styles */
#wpadminbar {
width:120px;
min-width:120px;
height:100%;
}
#wpadminbar ul li {
width:100%;
}
add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
function bpdev_exclude_users($qs=false,$object=false){
//list of users to exclude
$excluded_user=join(',',bpdev_get_subscriber_user_ids());//comma separated ids of users whom you want to exclude
if($object!='members')//hide for members only
return $qs;
$args=wp_parse_args($qs);
<?php
namespace Custom_Reg;
class Custom_Reg {
protected $form;
protected $saver;
function __construct( Form $form, Saver $saver ) {
/**********************
Foundation Top-Bar
***********************/
add_action('wp_head', 'admin_bar_fix', 5);
function admin_bar_fix() {
if( !is_admin() && is_admin_bar_showing() ) {
remove_action( 'wp_head', '_admin_bar_bump_cb' );
$output = '<style type="text/css">'."\n\t";
//$output .= 'body.admin-bar { padding-top: 28px; }'."\n";