Command Line
pry -r ./config/app_init_file.rb- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb- load your rails into a pry session
Debugger
| using System.Diagnostics.CodeAnalysis; | |
| using UnityEngine; | |
| // Dont forget to add "using RDG;" to the top of your script! | |
| namespace RDG | |
| { | |
| /// <summary> | |
| /// Class for controlling Vibration. Automatically initializes before scene is loaded. | |
| /// </summary> | |
| public static class Vibration |
| # spec/support/elasticsearch.rb | |
| RSpec.configure do |config| | |
| config.before :each do | |
| stub_request(:any, /localhost:9200/).to_return(body: "<html>a webpage!</html>", status: 200) | |
| end | |
| end |
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '~> 5.0.0' | |
| # Use sqlite3 as the database for Active Record | |
| gem 'sqlite3' | |
| # Use Puma as the app server | |
| gem 'puma', '~> 3.0' | |
| # Use SCSS for stylesheets |
| #!/usr/bin/env bash | |
| # Source: https://gist.github.com/jordan-brough/48e2803c0ffa6dc2e0bd | |
| # See also: https://stackoverflow.com/a/25095062/58876 | |
| # Download this script as "git-recent" (no extension), chmod it to be executable and put it in your | |
| # path somewhere (e.g. /usr/bin). You can then use it via `git recent` from inside any git repo. | |
| # Examples: |
| function jetpackme_related_posts_past_halfyear_only( $date_range ) { | |
| $date_range = array( | |
| 'from' => strtotime( '-6 months' ), | |
| 'to' => time(), | |
| ); | |
| return $date_range; | |
| } | |
| add_filter( 'jetpack_relatedposts_filter_date_range', 'jetpackme_related_posts_past_halfyear_only' ); |
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
| var serializeHash = function () { | |
| var attrs = {}; | |
| $.each($(this).serializeArray(), function(i, field) { | |
| attrs[field.name] = field.value; | |
| }); | |
| return attrs; | |
| }; |
| # Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files | |
| # for Pry binding references | |
| # | |
| # Installation | |
| # | |
| # ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit | |
| # | |
| # Based on | |
| # | |
| # http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/ |
| #!/usr/bin/env ruby | |
| # Put this file in the root of your Rails project, | |
| # then run it to output the SQL needed to change all | |
| # your tables and columns to the same character set | |
| # and collation. | |
| # | |
| # > ruby character_set_and_collation.rb | |
| DATABASE = '' |