This file contains hidden or 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 ActiveExchange | |
| class Channel | |
| def initialize(name:, server: ActiveExchange.server) | |
| @server = server | |
| @channel = name | |
| @queue = Queue.new | |
| @subscribe = false | |
| end | |
| def broadcast(message) |
This file contains hidden or 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
| const getColors = require('get-image-colors'); | |
| const imageURL = "https://images.unsplash.com/photo-1539806190169-9b25397a73b6" | |
| function extractColor(url = imageURL) { | |
| const c = here(url) | |
| return formattedPalette(c) | |
| } | |
| function here(url) { | |
| getColors(url).then(colors => { |
This file contains hidden or 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
| { | |
| "auto_complete": true, | |
| "bold_folder_labels": true, | |
| "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
| "command": "dev_docs_search_selection", | |
| "copy_with_empty_selection": true, | |
| "detect_indentation": false, | |
| "ensure_newline_at_eof_on_save": true, | |
| "folder_exclude_patterns": | |
| [ |
This file contains hidden or 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
| /* White Space */ | |
| $space-1: .5rem; | |
| $space-2: 1rem; | |
| $space-3: 2rem; | |
| $space-4: 4rem; | |
| .m1 { margin: $space-1 } | |
| .mb1 { margin-bottom: $space-1 } | |
| .mt1 { margin-top: $space-1 } |
This file contains hidden or 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
| //helper method for writing out json payloads | |
| var json = function(res, data) { | |
| res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); | |
| if(typeof data === "string") res.write(data); | |
| else res.write(JSON.stringify(data)); | |
| res.end(); | |
| }; |
This file contains hidden or 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 ApplicationHelper | |
| def is_active?(link_path) | |
| current_page?(link_path) ? "active" : "" | |
| end | |
| end | |
| <li class="<%= is_active?(some_path) %>"> | |
| <%= link_to "name path", some_path %> | |
| </li> |
This file contains hidden or 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
| # rails new generator -d postgresql -m /path/to/app_template.rb | |
| # FILES | |
| # ------------------------------------------------------------------------------------------------------ | |
| remove_file 'README.rdoc' | |
| create_file 'README.md', "# Readme | |
| ## Getting started | |
| 1. Clone and rename database.sample.yml |
This file contains hidden or 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
| if ENV['RAILS_ENV'] | |
| IRB.conf[:PROMPT_MODE] = :SIMPLE | |
| require 'irb/completion' | |
| require 'hirb' | |
| # Hirb.enable | |
| Hirb.enable output: {"ActiveRecord::Base" => {class: :auto_table, ancestor: true, options: {vertical: true}}} | |
| end |
This file contains hidden or 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
| Commit Message [T: 2:03] | |
| Commit Message [t:2:3] | |
| Commit Message [t:2] | |
| Commit Message [T: 3] | |
| Commit Message [ t : 4] | |
| Commit Message [ T: 5] | |
| Commit Message [t:120] | |
| Commit Message [t:2 : 03] | |
| Commit Message [t: 2 : 03 ] | |
| Commit Message [t:2h:03] |