GithubHelp home page GithubHelp logo

learning's People

learning's Issues

Bash

Processes

  • ctrl-z puts current process in background
  • [command]& automatically starts process in background
  • jobs shows current background processes
  • fg %N puts process in foreground
  • top real time process watching (constant ps)
  • ps aux
    a = show processes for all users
    u = display the process's user/owner
    x = also show processes not attached to a terminal

Loop through stdout

awk grabs specific column

convox apps | awk '{ print $1 }' | while read line; do
    echo "$line"
    convox env -a $line | grep -i dynamo
    #my_process "$line"
done

Cool Vim Tricks

Bookmarks

Set bookmark

m [char]

Go to bookmark

' [char]

Multiple Clipboards

Set in clipboard

" [char] [operation]

Pull from clipboard

" [char] [operation]

Navigation

Go to right before character

t [char]

Go to character

f [char]

Search and Replace

:%s/[old_word]/[new_word]/gc
g: whole line
c: interactive
%: whole buffer

Sort

Visually select and then :sort

In operator

You can do operators within objects with i.

  • v+i+[ would select everything within the brackets
  • c+i+[ would cut everything within the brackets

Directory

  • e . goes to top level directory
  • 'E' goes to current directory

Testing Emails Rails

Overview

Option 1

Rails Preview_Mailer

class InstantReviewNotificationMailerPreview < ActionMailer::Preview
  def send_noti
    user = User.find(37)
    user_id = user.id
    org_name = 'Test Org'
    org_id = 1
    id = nil
    locs = nil

    InstantReviewNotifications::Delivery.new.send(:notis_for_org, org_id).each do |user_id, locations|

      id = user_id
      locs = locations
      break
    end

    InstantReviewNotificationMailer.send_noti(id, locs, org_name)
  end
end

go to http://localhost:3000/rails/mailers/instant_review_notification_mailer/send_noti

Option 2

mailtrap

rails c
user_id = User.find(37).id
locations = [{
  'id' => 1,
  'name' => 'test org',
  'reviews' => [{ 'rating' => 4, 'author' => 'Johnny B. Goode', 'site' => 'google' }]
}]
org_name = 'Test Org'
InstantReviewNotificationMailer.send_noti(user_id, locations, org_name).deliver_now

Sign into mailtrap.io and look at demo inbox for your email

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.