Skip to content

Instantly share code, notes, and snippets.

View nydame's full-sized avatar

Felicia Betancourt nydame

View GitHub Profile
@paulovera
paulovera / sublime-mac.textile
Last active April 12, 2022 10:42 — forked from lucasfais/gist:1207002
SUBLIME TEXT MAC- Keyboard's Shortcuts Cheat Sheet

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@heldervilela
heldervilela / add-gift-box.php
Last active May 4, 2023 08:39
woocommerce custom checkout field to add fee to order ajax
<?php
/**
* Add html
*
* @version 1.0.0
* @since 1.0.0
*/
add_action( 'woocommerce_after_checkout_billing_form', 'add_box_option_to_checkout' );
function add_box_option_to_checkout( $checkout ) {
@woogists
woogists / wc-skeleton-shipping-method-example.php
Last active September 9, 2023 07:52
[Shipping Method API] WooCommerce skeleton shipping method plugin code example.
<?php
/*
Plugin Name: Your Shipping plugin
Plugin URI: https://woocommerce.com/
Description: Your shipping method plugin
Version: 1.0.0
Author: WooThemes
Author URI: https://woocommerce.com/
*/