Skip to content

Instantly share code, notes, and snippets.

View koryteg's full-sized avatar
🏠
Working from home

Kory Tegman koryteg

🏠
Working from home
View GitHub Profile
@koryteg
koryteg / settings.json
Last active September 16, 2019 21:22
vim test workflow in vs code
//this file is an example of using leader + t to runn the current spec in vs code.
// you need two extentions:
// vim-mode
// rails run specs
// once those are installed add this to the config:
{
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "T"],
"commands": ["extension.runFileSpecs"]
@koryteg
koryteg / targets.js
Created July 18, 2017 16:11
adjusting eh target!
/* eslint-env node */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var ENV = {
browsers: [
'last 1 Chrome versions',
'last 1 Firefox versions'
]
};
@koryteg
koryteg / rspec_config.rb
Created April 7, 2016 20:56
rspec filter gist
RSpec.configure do |config|
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
@koryteg
koryteg / test.rb
Created December 16, 2015 01:58
factory girl test
require "rails_helper"
RSpec.describe CampaignMailingTemplate, type: :template_object do
before(:all) do
# old factory girl code
# @entity = create(:entity)
# @campaign = create(:campaign, entity: @entity)
# @campaign_mailing = create(:campaign_manual_reminder, campaign: @campaign)
# @invitation = build(:invitation, guest: build(:user))
create_entity
@koryteg
koryteg / gist:b5bb66c836ab427152c2
Created July 14, 2015 17:46
mongo dump restore
tar xvzf your_database.tar.gz
mongodump --dbpath your_database
mongorestore
In Robomongo:
use amplo_development
db.dropDatabase()
db.copyDatabase('amplo', 'amplo_development')
@koryteg
koryteg / application.js
Created April 30, 2015 22:45
service objects
import Ember from 'ember'
var ApplicationController = Ember.Controller.extend({
settings: Ember.inject.service(),
updateCurrentPath: funtion(){
this.set('settings.currentPath', this.get("currentPath") );
}.observes("currentPath")
export default ApplicationController;
@koryteg
koryteg / app.js
Last active August 29, 2015 14:20
es6
import Settings from 'settings'
var App = function(){
secretAdminStuff: function(){
if (settings.admin){
// return all your admin stuff!!
}else{
// return nothing!
}
},
@koryteg
koryteg / index.hbs
Last active August 29, 2015 14:17
valid-form component
<!--this is how you would use it: -->
{{#valid-form model=model action="createModel" }}
<div class="form-group">
<label for="name">Name</label>
{{valid-input-container property="name" placeholder="Name"}}
</div>
<div class="form-group">
<label for="descr">Description</label>
{{valid-input-container property="descr" placeholder="description"}}
</div>
@koryteg
koryteg / new_gist_file_0
Created December 4, 2013 22:56
setup htaccess passwords
http://www.htaccesstools.com/htaccess-authentication/
AuthType Basic
AuthName "staging"
AuthUserFile /home/content/84/10444784/html/staging/.htpasswd
Require valid-user
<?php
$dir = dirname(__FILE__);
@koryteg
koryteg / Common_Magento_Things.php
Created November 14, 2013 22:12
common Magento things
<?php // adding the product and helper objects in magento
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct();
// getting a product from the what was registered on the page
$_product = Mage::registry('product');