Skip to content

Instantly share code, notes, and snippets.

View johnantoni's full-sized avatar

John Griffiths johnantoni

View GitHub Profile
@r00k
r00k / gist:5885955
Created June 28, 2013 16:19
Notes for my talk at Engineers4Engineers at Constant Contact on 6/28/13.
My name is Ben Orenstein and I work at thoughtbot in Boston.
Notes will be published.
I'd like to tell you a story. (5:42)
I've never talked about this publicly.
Umass.
Second job.
Version control.
Successful since then.
@HotFusionMan
HotFusionMan / .irbrc
Last active July 26, 2016 08:31
A useful Rails 4 .irbrc file (for use with Rails-project-specific .irbrc file loading capability from http://railsbros.de/2010/11/29/a-custom-irbrc-for-rails-3.html ). See earlier revisions for Rails 3 version.
def show_controller_action_callbacks
_process_action_callbacks.map(&:filter)
end
alias :action_callbacks :show_controller_action_callbacks
def recognize_path(path, environment = { :method => 'GET', :extras => {} })
(@named_routes ||= Rails.application.routes).recognize_path(path, environment)
end
alias :recognize_route :recognize_path
@wycats
wycats / jsonapi.md
Created May 1, 2013 00:58
Ember APIs

JSON API

There are two JSON API styles:

  • The ID Style
  • The URL Style

The ID style is the easiest to get started with, but requires that your clients be able to guess the URLs for related documents. It also locks your API into a particular URL structure, which may become a problem as your API grows.

The URL style requires less guessing on the client side, and makes clients more resilient to API changes, but is trickier to use with relationships and compound documents.

@johnantoni
johnantoni / schema.xml
Last active October 16, 2018 18:09
sunspot solr on a linode vps
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@johnantoni
johnantoni / dd-wrt.markdown
Last active August 15, 2020 17:52
DD-WRT on WRT54G + OpenVPN

for a Linksys WRT54G router (v2.0)

  1. download the openvpn firmware version from http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fothers%2Feko%2FV24_TNG%2Fsvn13491-snow%2FVINT/
  2. set you static ip to 192.168.1.7 and connect directly to the router via ethernet cable, disconnect internet from the router.
  3. once connected, update the firmware with the one you just downloaded from the link above.
  4. once done, successfully, reboot.
  5. re-connect the internet cable.
  6. 99% of the time it will reboot, though there's a fine chance of bricking the router so if you can get one from a yardsale, cheaper that way.
  7. once booted, navigate browser to 192.168.1.1
  8. login, the username & password could be either root/root root/admin admin/admin admin/password root/password.
@kylefox
kylefox / gist:4512777
Created January 11, 2013 18:15
If you want to use Xcode's FileMerge as your git mergetool, this is how you set it up.
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
@johnantoni
johnantoni / Gemfile
Last active December 10, 2015 09:49
guardfile + gemfile setup (bundler, solr, delayed jobs)
group :development do
# tools
gem 'rails3-generators'
gem 'letter_opener'
gem 'database_cleaner'
gem 'yajl-ruby'
gem 'crack'
gem 'quiet_assets'
#gem 'ruby_gntp' # growl notifications
@johnantoni
johnantoni / .htaccess
Created December 28, 2012 14:59
.htaccess for wordpress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@johnantoni
johnantoni / .htaccess
Created December 28, 2012 14:56
.htaccess for textpattern
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /relative/web/path/
@johnantoni
johnantoni / archlinux.config
Created December 2, 2012 09:04
archlinux setup
-----------
parted
mklabel gpt
unit MiB
mkpart biosboot 0 5
set 1 bios_grub on