- How can you include an
init
function in your module and why is it useful?
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
<h1>HTML Kitchen Sink</h1> | |
<h2>a</h2> | |
<a href="#">a</a> | |
<br> | |
<h2>abbr</h2> | |
<abbr title="abbr">Mr. Mrs. Dr.</abbr> | |
<br> |
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
[ | |
{ "keys": ["super+shift+w"], "command": "close_all" } | |
] |
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
// ---------------------------------------- | |
// Folder jQuery plugin | |
// ---------------------------------------- | |
// Usage: | |
// | |
// $('.folder.month').folder(); | |
// $('.folder.year').folder({ | |
// iconOpen: 'fa-folder-open', | |
// iconClosed: 'fa-folder' | |
// }); |
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
// -------------------------------------------------- | |
// JavaScript Do's and Dont's | |
// -------------------------------------------------- | |
// | |
// This is a list of gotchas and best practices | |
// mostly dealing with the MVC and Module pattern | |
// | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundBlur</key> | |
<real>0.0</real> | |
<key>BackgroundColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc00w |
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
// ---------------------------------------- | |
// FlashService | |
// ---------------------------------------- | |
// Usage: | |
// 1. Inject FlashService into your controller | |
// 2. Bind to $scope | |
// $scope.flash = FlashService; | |
// or | |
// Use internally as FlashService | |
// 3. Use in your view or controller |
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 Searchable | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
@@searchable_fields = [] | |
@@searchable_scope = nil | |
def search(q, method=nil) |
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
# Creates an Edge List of People | |
# e.g. [ [Person1, Person2, weight], | |
# [Person4, Person8, weight], | |
# ... ] | |
require 'pry-byebug' | |
Person = Struct.new(:id, :name) | |
NAMES = [ | |
"Harry", "Sally", "Sam", "Michael", "Michelle", "Alok", "Dan", "Nick", "Olga", "Alice", "Joseph", "Donald", "Garrett", "Xin", "Mike", "Adam", "Peter", "Andur", "Tom", "Boris" |
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
var FlashHelper = {}; | |
FlashHelper.bootstrapAlertClassFor = function(key) { | |
return { | |
"error": "danger", | |
"alert": "danger", | |
"notice": "info" | |
}[key] || key; | |
}; |