Skip to content

Instantly share code, notes, and snippets.

View joshua-chavanne's full-sized avatar
:octocat:
Git'n stuff done

joshua chavanne joshua-chavanne

:octocat:
Git'n stuff done
  • laudable info
  • oakland, ca
View GitHub Profile
@Chaser324
Chaser324 / GitHub-Forking.md
Last active April 20, 2025 17:10
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@natelandau
natelandau / .bash_profile
Last active April 9, 2025 08:09
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@grandmanitou
grandmanitou / gist:8863248
Created February 7, 2014 14:10
Place multiple markers with infowindow on Google Maps API v3, use external links to trigger click and center map on desired location.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?language=fra&amp;sensor=false"></script>
<script type="text/javascript">
var map;
var Markers = {};
var infowindow;
var locations = [
[
'Samsung Store Madeleine',
'<strong>Samsung Store Madeleine</strong><p>5 Boulevard Malesherbes, 75008 Paris<br>10h – 20h</p>',
48.8701925,
@bonny
bonny / simple_fields-set-post-connector-with-code.php
Last active May 9, 2016 18:49
Simple Fields examples: - how to hide post connector drop down on edit post screen using PHP - how to select post connector for a post using PHP
<?php
/**
* Set post connector for a post using PHP.
*
* This way it's possible to select a post connector for posts based on their ID, categories, tags, post type, and so on
*
* This function is using the filter simple_fields_get_selected_connector_for_post that is called when
* simple fields determines what connector it should use for each post.
* It passes the connector slug and the post object and you should return the slug of the conector that you want to use.
@jaredatch
jaredatch / gist:5645033
Last active February 4, 2023 12:51
Modify/change the default allowed tags for bbPress.
<?php
/**
* Modify/change the default allowed tags for bbPress.
*
* The default list (below) is in bbpress/includes/common/formatting.php, L24-66.
* Adjust below as needed. This should go in your theme's functions.php file (or equivilant).
*/
function ja_filter_bbpress_allowed_tags() {
return array(
<?php
// Loop through a wp query obj
$wp_query_obj = new wp_query('post_type=regions&posts_per_page=3&orderby=title&order=asc');
with_posts($wp_query_obj, function($post, $arr_info) {
echo "<p>I am post number" . $arr_info["current_post"] . " of " . $arr_info["post_count"] " found post(s).</p>";
echo "<p>My title is: " . get_the_title() . "</p>";
echo "<p>And my slug is: " . $post->post_name . "</p>";
});
?>
@bonny
bonny / with-posts-wordpress-function.php
Last active May 9, 2016 18:50
WordPress function with_posts(), that simplifies getting and looping posts, in a jQuery anonymous function-ish way. Setups global, restores post afterwards. Simple, flexible and powerful.
<?php
/**
* WordPress WP_QUERY-wrapper to simplify getting and working with posts
*
* Does something with posts, using a callback
* Setups global post variable before running callback
* And restores it afterwards
*
* An introductionary blogpost about this function is posted on our blog:
@bonny
bonny / 1-simple-fields-register-field-group-small-example.php
Last active July 14, 2022 11:34
Simple Fields simple_fields_register_field_group(), simple_fields_register_post_connector(), simple_fields_register_post_type_default() examplesSee http://simple-fields.com/ for more info.
<?php
// Minimal amount of code
// to create a new field group
// with one field
simple_fields_register_field_group('attachment', array(
'name' => 'Attachment',
'fields' => array(
array(
'name' => 'File',
@Zirak
Zirak / gist:3086939
Last active August 27, 2022 22:01
xhr for dummies

So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.

You get a hold on such a prime beast like this: