- Dynamic Dispatch
- Dynamic Method
- Ghost Methods
- Dynamic Proxies
- Blank Slate
- Kernel Method
- Flattening the Scope (aka Nested Lexical Scopes)
- Context Probe
- Class Eval (not really a 'spell' more just a demonstration of its usage)
- Class Macros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} | |
extend ActiveSupport::Concern | |
included do | |
$2 | |
end | |
end]]></content> | |
<tabTrigger>mod</tabTrigger> | |
<scope>source.ruby, source.ruby.rails, source.rails</scope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ensure regex button is selected and then type this in the search field. | |
\s*console\.log(.*); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Themes::PerspectiveTheme::MainHelper | |
def self.included(klass) | |
klass.helper_method [:perspective_social_networks] rescue "" # here your methods accessible from views | |
end | |
def perspective_theme_settings(theme) | |
# callback to save custom values of fields added in my_theme/views/admin/settings.html.erb | |
end | |
# callback called after theme installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with the same name as the keys in <tt>filtering_params</tt> | |
# with their associated values. Most useful for calling named scopes from |
##Refs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// use customized monokai color scheme (created with the awesome | |
// tmtheme-editor - see http://tmtheme-editor.herokuapp.com) | |
"color_scheme": "Packages/User/MonokaiCustomized2.tmTheme", | |
"ensure_newline_at_eof_on_save": false, | |
"use_simple_full_screen": false, | |
// glasses are expensive, protect your eyesight |
NewerOlder