Skip to content

Instantly share code, notes, and snippets.

View rossta's full-sized avatar
💭
Being curious

Ross Kaffenberger rossta

💭
Being curious
View GitHub Profile
@rossta
rossta / railsconf-notes.md
Last active August 29, 2015 14:20
railsconf 2015 notes

RailsConf Show & Tell

Keynotes

  • Kent Beck: "A man cannot be comfortable without his own approval" - Mark Twain *
  • DHH @ 00:26:00: Rails API and Action Cable
  • Tenderlove: Just watch

Culture

$ npm install --save-dev [email protected]
> [email protected] install /Users/ross/dev/challengepost/bridge/node_modules/ember-cli/node_modules/testem/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
@rossta
rossta / configure_nginx_rails.rb
Last active August 29, 2015 14:17
Configure nginx for rails
#!/usr/bin/env ruby
require 'erb'
puts "Generating nginx config..."
app_root = Dir.getwd
app_name = File.basename(app_root)
public_path = File.join(app_root, 'public')
@rossta
rossta / query.sql
Created March 13, 2015 20:47
Find largest tables on MYSQL server
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
@rossta
rossta / sunspot.yml
Created June 6, 2014 14:57
Updated sunspot yml
test:
solr:
hostname: localhost
port: 9008
log_level: WARNING
solr_home: solr
development:
solr:
hostname: localhost
@rossta
rossta / nginx_functions.zsh
Created June 3, 2014 20:10
nginx functions
lsnginx() {
ps -A -o pid,command | grep '[n]ginx'
}
startnginx() {
sudo nginx -c /web/platform/config/nginx/nginx.conf
}
startnginxssl() {
sudo nginx -c /web/platform/config/nginx/nginx.ssl.conf
@rossta
rossta / transliteration.yml
Created May 5, 2014 17:31
Default I18n transliteration converted to YAML
# I18n::Backend::Transliterator::HashTransliterator::DEFAULT_APPROXIMATIONS.to_yaml
---
À: A
Á: A
Â: A
Ã: A
Ä: A
Å: A
Æ: AE
Ç: C
@rossta
rossta / flag_datafix.rb
Last active August 29, 2015 13:57
Notes for orphaned flag datafix
# flags orphaned from forum topics (discussions)
Flag.joins("LEFT OUTER JOIN forum_topics ON flags.flaggable_id = forum_topics.id").where('forum_topics.id IS NULL').where(flaggable_type: 'ForumTopic')
# flags orphaned from comments
Flag.joins("LEFT OUTER JOIN comments ON flags.flaggable_id = comments.id").where('comments.id IS NULL').where(flaggable_type: 'Comment')
@rossta
rossta / find_and_replace.sh
Created February 4, 2014 22:42
Find and replace in directory on the shell
# example: replacing :mocha with :rspec as mock framework
find . -name '*_spec.rb' -exec sed -i.old -e 's/returns/and_return/' {} \;
find . -name '*_spec.rb' -exec sed -i.old -e 's/expects/should_receive/' {} \;
find . -name '*_spec.rb' -exec sed -i.old -e 's/stubs/stub/' {} \;
find . -name '*.old' -exec rm {} \;
@rossta
rossta / scalable-js-resources.md
Last active November 12, 2023 01:41
Resources for Learning Scalable Javascript Architecture

Scalable JS Resources

Forget what you know about Javascript MVC patterns from your experience with Backbone, Ember, Angular, Knockout, Batman, and yada yada. I encourage you to empty your cup, take a step back and open your mind to the ideas presented in the following resources, primarily from minds of Nicholas Zakas and Addy Osmani, two individuals I consider to be thought leaders in the front-end development world.