Skip to content

Instantly share code, notes, and snippets.

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@jackperry
jackperry / gist:7040013
Created October 18, 2013 11:07
Trying to use http://www.howtoinstallghost.com/how-to-host-ghost-on-an-apache-subdomain/ to get WordPress installs and a Ghost install working together properly. Thought it worked for a minute, but the WordPress domain (DOMAIN.com) just went to the Ghost one (DOMAIN2.com) as well.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName DOMAIN.com
ServerAlias www.DOMAIN.com
DocumentRoot /var/www/DOMAIN.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
@jackperry
jackperry / gist:6084768
Created July 25, 2013 23:34
sublime user settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Tomorrow/Tomorrow-Night.tmTheme",
"font_face": "Source Code Pro",
"font_size": 14,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
@jackperry
jackperry / rwafi.js
Last active December 18, 2015 18:09
Remove WordPress autop From Images
$("#page_whole > p > a > img").each(function(index){
if($(this).parent().parent().is("p")){
$(this).parent().unwrap();
}
});
@jackperry
jackperry / gist:5731331
Last active December 18, 2015 05:18
For Stephen.
<?php
$post_title = get_the_title();
if($post_title == 'x'){
echo $post_title."y";
} else {
echo $post_title;
}
?>
@jackperry
jackperry / gist:3971327
Created October 29, 2012 03:31
GiantBomb Game Data Download
from __future__ import print_function
import giantbomb
gb = giantbomb.Api('fe35a7029d3d80722ab9d05d4a9a4c53e115f4f8')
f = open('games.txt', 'w')
for num in range(1,41000):
try:
game = gb.getGame(num)
print('"'+str(game.id)+'"'+',"'+str(game.name)+'","'+str(game.deck)+'"', file=f)
except Exception, error:
@jackperry
jackperry / gist:3971082
Created October 29, 2012 02:26
GiantBomb Image Download
import urllib
import giantbomb
gb = giantbomb.Api('apikeyhere')
for num in range(1,41000):
try:
game = gb.getGame(num)
for key, value in dict.items(game.image):
if key == "super_url":
super_img = str(value)
@jackperry
jackperry / gist:2910236
Created June 11, 2012 14:04
Disable ST2 Remember Open Files
{
"hot_exit": false,
"remember_open_files": false
}
@jackperry
jackperry / gist:1955918
Created March 2, 2012 05:27
Wordpress Save Custom Fields on Autosave
<?php
function save_fields()
{
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return $post_id;
global $post;
update_post_meta($post->ID, 'field_name', $_POST['field_name']);
}
@jackperry
jackperry / gist:1781556
Created February 9, 2012 17:51
Sarah Winnem CPT
Want my newsroom to be url.com/newsroom (currently throws a 404)
Posts should be url.com/newsroom/post-title (currently works)
Code in functions.php:
// newsroom custom content type
function bment_post_type_newsroom() {
register_post_type(
'newsroom', array(
'labels' => array(