Skip to content

Instantly share code, notes, and snippets.

View collinprice's full-sized avatar

Collin Price collinprice

View GitHub Profile
@collinprice
collinprice / a.sh
Created August 25, 2013 22:50
GPSBabel download waypoints and tracks from Garmin device.
sudo gpsbabel -t -w -i garmin -f usb: -o gpx -F out.gpx
@collinprice
collinprice / gist:6210253
Created August 12, 2013 11:59
Args to GDB
gdb --args ./main -i settings.cfg
@collinprice
collinprice / gist:6108034
Created July 29, 2013 21:31
C string in C++
#define C_TEXT( text ) ((char*)std::string( text ).c_str())
@collinprice
collinprice / gist:6092141
Created July 26, 2013 20:51
Generic C++ Makefile that needs to include C sources.
CC = gcc
CXX = g++
CXXFLAGS = -c -Wall -Wextra -pedantic
CCFLAGS = -c
LDFLAGS = -lpthread
CPP_SRC = main.cpp
CPP_SRC_OBJS = $(CPP_SRC:.cpp=.o)
@collinprice
collinprice / gist:6021886
Created July 17, 2013 15:54
Got a UIButton inside a UIView and you can't press the button?
[btn setUserInteractionEnabled:YES];
@collinprice
collinprice / gist:5995154
Created July 14, 2013 18:13
Add this to the beginning of a file to remove those pesky redefinition errors.
#pragma once
@collinprice
collinprice / gist:5924576
Created July 4, 2013 02:55
Wordpress Divided Menu
function slice_menu($menu_name) {
if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menu_items = wp_get_nav_menu_items($menu->term_id);
$menu_list = '<dl class="sub-nav">';
$menu_counter = count($menu_items);
foreach ( (array) $menu_items as $key => $menu_item ) {
$title = $menu_item->title;
@collinprice
collinprice / gist:5923790
Created July 3, 2013 23:34
Wordpress broken due to enabling permalinks
Check .htaccess permissions. Should be 644.
@collinprice
collinprice / gist:5884781
Last active December 19, 2015 02:39
C++ Notes
// Create/Remove directories
#include <sys/stat.h>
// #include <sys/types.h> // Only needed if you want access to mode_t type
mkdir("folder", 0755);
rmdir("folder");
// Uniform Random
# Go to the directory
cd trunk/
# Add just the single file to the current directories ignore list (like above)
# Note the dot at the end of the command is important
svn propset svn:ignore secret.txt .
# See that things worked
svn propget svn:ignore . # Notice the single file was added to the list
svn status --no-ignore # You should see an 'I' next to the ignored files