Skip to content

Instantly share code, notes, and snippets.

View chrisatomix's full-sized avatar

Chris Atomix chrisatomix

View GitHub Profile
@chrisatomix
chrisatomix / add-custom-post-type-menu.php
Created September 8, 2015 06:29 — forked from tommcfarlin/add-custom-post-type-menu.php
[WordPress] Add a custom post type menu as a child of an existing custom post type menu.
<?php
// Define the 'Portfolio' post type. This is used to represent galleries
// of photos. This will be our top-level custom post type menu
$args = array(
'labels' => array(
'all_items' => 'Gallery',
'menu_name' => 'Portfolio',
'singular_name' => 'Gallery',
'edit_item' => 'Edit Gallery',
@chrisatomix
chrisatomix / .gitignore
Created January 22, 2015 03:10
Joomla Gitignore File
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
@chrisatomix
chrisatomix / 0_reuse_code.js
Created July 18, 2014 01:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@chrisatomix
chrisatomix / download_bandcamp.php
Last active December 29, 2015 09:59 — forked from navinpai/download_bandcamp.php
Modified to support different data format, cleaner filenames and basic error checking.
<?php
/* I'm absolutely in love with BandCamp as a platform for musicians, both in terms of concept and UI/UX and the artists on on it.
The music is awesome, so wrote this small script to scrape the music off the album pages on BandCamp to your computer. Yes, they're 128K MP3s, not the higher def that the site offers for purchase, but beggars can't be choosers right? :P
Simple script, basic CURL-ing :)... Downloads songs to the songs folder. So folder structure should be:
|-download_bandcamp.php
|--songs
Coded while listening to 'As Of Yet Unnamed' by Mayhem, who's a personal inspiration (He's Renard Queenston AKA Renard, Adraen, Azrael, Furries in a Blender (formerly named Emoticon), Jackal Queenston, Kitsune, Klippa, Mayhem and NegaRen), for the numerous avatars of music he plays, each so awesome! :)
Check him out on: http://www.lapfoxtrax.com/ :)
@chrisatomix
chrisatomix / gist:6360730
Created August 28, 2013 00:22
Proof of concept Toggl API MultiRequest to load currently running timers.
<?php
/**
* Perform a multi-request to the Toggl API
* @param String $url The API URL you are requesting
* @param String $method HTTP Request Method (should be 'GET')
* @param Array $tokens An array of Toggl API Tokens and names
* @return Array An array of Time Entries
*/
function multiRequest($url, $method, $tokens) {