- clicking through on the method name, pressing
⌥ ⌘ B
while the cursor is on the method name ⌥ ⏎
is to create missing class, method etc- press
⌃ ⇧ R
to run this individual test. - Highlight the code you want to extract to a variable and press
⌥ ⌘ V
(macOS) - Highlight the code you want to extract to a method and press
⌥ ⌘ M
(macOS) - View all the methods available in a given Interface or Class
fn + ⌘ + F12
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
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
class GFG { | |
public static void main (String[] args) throws Exception { | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
int tests = Integer.valueOf(br.readLine()); |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
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
#!/bin/sh | |
# | |
# save this file with this name and mark it executable `chmod +x .git/hooks/commit-msg` | |
commit_desired_format='(ZA-\d+|GH-\d+|merge)' | |
error_msg="Aborting commit. Commit message is missing ('ZA-XXX') or ('GH-XXX') or 'merge'" | |
if ! grep -iqE "$commit_desired_format" "$1"; then | |
echo "$error_msg" >&2 | |
exit 1 |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
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 Amura | |
class SidekiqManager | |
# a datastructure to maintain queue meta data. the structure of which is {host_name: {queue_name:{min:1,max:1,conc:10,latency:1,queue_size:10,kill_idle:-1, tags:['default'], total_checks:1,current_check:0}}} | |
# host_name - name of the machine where its running. useful in a distributed environment where app is running on mulitple instances | |
# queue_name - name of the queue (which you can mention in the sidekiq worker as sidekiq_options :queue => :mailer ) | |
# min: minimum number of processes required to process this queue on this machine. | |
# max: maximum number of processes permitted to process this queue on this machine. a upper limit to avoid memory overflow and unlimited process spawning. | |
# conc: concurreny (number of worker threads) for each of the processes. this is -C option given while booting up sidekiq. | |
# latency: this is the default safe latency which is permissable for this queue. anything beyond this will trigger new p |
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
gem: --no-ri --no-rdoc | |
install: --no-rdoc --no-ri | |
update: --no-rdoc --no-ri |
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 ModuleWithPersonalisedMethods | |
def self.included(klass) | |
@methods_definer.call(klass) | |
end | |
@methods_definer = lambda do |klass| | |
klass_name = klass.name.downcase | |
klass.class_exec do | |
define_method "#{klass_name}_m1" do |arg1 = nil| |
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
group :development do | |
gem 'annotate' | |
gem 'better_errors' | |
gem 'binding_of_caller' | |
gem 'bullet' | |
gem 'mailcatcher' | |
gem 'pry-rails' | |
gem 'quiet_assets' | |
gem 'xray-rails' | |
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
class Application < Rails::Application | |
# ... | |
config.generators do |g| | |
g.test_framework false | |
g.scaffold_controller "scaffold_controller" | |
g.stylesheets false | |
g.javascripts false | |
g.helper false | |
end | |
end |
NewerOlder