Skip to content

Instantly share code, notes, and snippets.

Avatar

will asecondwill

View GitHub Profile
View gist:34831004b191fa3ac52353ead47c5a64
Prefix Verb URI Pattern Controller#Action
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
user_password PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
POST /users/password(.:format) devise/passwords#create
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
View gemfile.lock
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.8)
actionpack (= 4.1.8)
actionview (= 4.1.8)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.8)
actionview (= 4.1.8)
activesupport (= 4.1.8)
View failing to install homebrew-php
Sites ❯ brew tap homebrew/homebrew-php
==> Tapping homebrew/php
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-php'...
remote: Counting objects: 650, done.
remote: Compressing objects: 100% (405/405), done.
remote: Total 650 (delta 354), reused 483 (delta 243), pack-reused 0
Receiving objects: 100% (650/650), 304.41 KiB | 0 bytes/s, done.
Resolving deltas: 100% (354/354), done.
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-php/Formula/arcanist.rb
Formulae found in multiple taps:
@asecondwill
asecondwill / gist:e3c99ad3d653619b05e9
Created Mar 25, 2015
Install new version of ruby
View gist:e3c99ad3d653619b05e9
rbenv install 2.2.0
rbenv rehash
gem install bundler
bundle install
View limit by post
function GetCertainPostTypes($query) {
if ($query->is_search) {
$query->set('post_type',array('person'));
}
return $query;
}
add_filter('pre_get_posts','GetCertainPostTypes');
View products.twig
{% extends "base.twig" %}
{% block sectionheader %}
<div class="gray">
<div class="row">
<div class="columns medium-2"><h2>Store</h2></div>
<div class="columns medium-10">
<div class="product-cats">
{% for cat in cats %}
View woocommerce.php
<?
$context = Timber::get_context();
$context['cats'] = Timber::get_terms('product_cat');;
if (is_singular('product')) {
$context['post'] = Timber::get_post();
$product = get_product( $context['post']->ID );
$context['product'] = $product;
add_action( 'mc_attributes', function($product){
$product->list_attributes();
@asecondwill
asecondwill / single-product.twig
Last active Jun 20, 2017
messing with timber & woo
View single-product.twig
{% extends "base.twig" %}
{% block sectionheader %}
<div class="gray">
<div class="row">
<div class="columns medium-2"><h2>Store</h2></div>
<div class="columns medium-10">
<div class="product-cats">
{% for cat in cats %}
<a href="{{cat.link}}">{{cat.name}}</a>
{% if not loop.last %} // {% endif %}
@asecondwill
asecondwill / has_many through create log
Created Aug 24, 2014
log showing hasmany through not creating records
View has_many through create log
Started POST "/helm/coupons" for 127.0.0.1 at 2014-08-24 09:58:25 +1000
Processing by Helm::CouponsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"h8OjO3zqPVofhgQ8VYECea4kCCnXU+Lkn7L2QPJUDcM=", "coupon"=>{"name"=>"test", "code"=>"test", "dollar_discount"=>"5", "percent_discount"=>"", "max_uses"=>"1000000", "max_uses_per_customer"=>"1000000", "starts_at(1i)"=>"2014", "starts_at(2i)"=>"8", "starts_at(3i)"=>"24", "starts_at(4i)"=>"09", "starts_at(5i)"=>"00", "expires_at(1i)"=>"2017", "expires_at(2i)"=>"8", "expires_at(3i)"=>"24", "expires_at(4i)"=>"09", "expires_at(5i)"=>"00", "activity_ids"=>["", "2", "3", "4"]}, "commit"=>"Saving..."}
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
Provider Load (0.4ms) SELECT "providers".* FROM "providers" WHERE "providers"."id" = $1 LIMIT 1 [["id", 1]]
Provider Load (0.5ms) SELECT "providers".* FROM "providers" WHERE "providers"."id" = $1 LIMIT 1 [["id", 1]]
(0.3ms)