Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan rondale-sc

View GitHub Profile
View pconsole.sh
# include this in your ~/.zshrc or ~/.bashrc
pconsole () {
if [[ $1 == production ]];
then RAILS_ENV=production bundle exec pry -r ./config/environment.rb -r rails/console/app -r rails/console/helpers;
elif [[ $1 == test ]];
then RAILS_ENV=test pry -r ./config/environment.rb -r rails/console/app -r rails/console/helpers;
else bundle exec pry -r ./config/environment.rb -r rails/console/app -r rails/console/helpers;
fi }
View components.my-component\.js
import Component from '@glimmer/component';
export default class extends Component {
}
@rondale-sc
rondale-sc / gist-1.rb
Created Mar 22, 2012
ruby-hough-hack
View gist-1.rb
# Authors: Robert Jackson, Jonathan Jackson
# the formatting of this file has been altered in
# order to fit on this website. Check out
# https://gist.github.com/1233581 if you care
require 'chunky_png' #or 'oily_png'
class Hough
def initialize(image_path, options={})
@image = ChunkyPNG::Image.from_file(image_path)
@image_path = image_path
View setup-syntastic-eslint.md

Syntastic setup:

Install:

vim-syntastic/syntastic

Add the following to ~/.eslintrc

{
View .vimrc.local
function! SelectaCommand(choice_command, vim_command)
try
silent! exec a:vim_command . " " . system(a:choice_command . " | selecta")
catch /Vim:Interrupt/
endtry
redraw!
endfunction
let g:selecta_command = 'find * ' .
\ '-type f ' .
View inline-svg-helper.js
// src/utilities/inline-svg/helper.js
// @ts-ignore:
import { svgs } from '../../../utils/svgs';
function dottify(path) {
return (path || '').replace(/^\//g, '').replace(/\//g, '.');
}
export default function inlineSvg([path]) {
View controllers.application.js
import Ember from 'ember';
import { inject as service } from '@ember/service';
import { getOwner } from '@ember/application';
export default Ember.Controller.extend({
routerService: service('router'),
appName: 'Ember Twiddle',
actions: {
actionOne() {
this.get('routerService').transitionTo('foo.bar.my-route', 1, { queryParams: { foo: 1 }});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
someComputed: Ember.computed('structure.subscriptions.[]', function() {
return 'Some Computed: ' + this.get('structure.subscriptions.firstObject.name');
})
});