NOTE:
$ indicates the following command should be done in command line.
Do not include the $ in your command.
-
iTerm2 - (unless you want to use default Terminal mac app)
-
Xcode Command Line Tools (also includes git)
| function areJsonStringsSimilar(jsonString1, jsonString2) { | |
| function areArraysSimilar(arr1, arr2) { | |
| if (arr1.length !== arr2.length) return false; | |
| for (let i = 0; i < arr1.length; i++) { | |
| if (typeof arr1[i] === 'object') { | |
| if (!areObjectsSimilar(arr1[i], arr2[i])) return false; | |
| } else if (arr1[i] !== arr2[i]) { | |
| return false; | |
| } |
| const debounce = (func, wait = 1000) => { | |
| let timeout; | |
| return function executedFunction(...args) { | |
| const later = () => { | |
| clearTimeout(timeout); | |
| func(...args); | |
| }; | |
| clearTimeout(timeout); |
| on alfred_script(q) | |
| tell application "iTerm2" | |
| activate | |
| do script q | |
| end tell | |
| end alfred_script |
NOTE:
$ indicates the following command should be done in command line.
Do not include the $ in your command.
iTerm2 - (unless you want to use default Terminal mac app)
Xcode Command Line Tools (also includes git)
| # cd and new tab stuff | |
| tell application "iTerm2" | |
| tell current window | |
| tell current session | |
| write text "cd ~/go/somewhere" | |
| write text "clear" | |
| end tell | |
| create tab with default profile | |
| tell current tab |
| #sample setup for vcr gem | |
| #spec/support/vcr.rb | |
| require 'vcr' | |
| VCR.configure do |c| | |
| c.cassette_library_dir = 'spec/support/cassettes' | |
| c.hook_into :webmock | |
| c.ignore_localhost = true | |
| c.configure_rspec_metadata! | |
| c.allow_http_connections_when_no_cassette = true |
If both the upstream and your feature branch have made changes to Gemfile, you will likely receive merge conflicts on Gemfile.lock when you rebase your feature branch. Don't try to resolve these manually; you'll probably just screw it up. Instead do this:
git checkout --ours Gemfile.lock
bundle
git add Gemfile.lock
git rebase --continue
This ensures that you get a correct Gemfile.lock at each step along the way.
| if self.reviews.count == 0 { | |
| var alert = UIAlertController(title: "Whoops...", message: "No reviews yet!", preferredStyle: UIAlertControllerStyle.Alert) | |
| alert.addAction(UIAlertAction(title: "Okay", | |
| style: UIAlertActionStyle.Default, handler: {(alert: UIAlertAction!) in | |
| self.navigationController?.popViewControllerAnimated(true) | |
| return //force return since popViewControllerAnimated(true) returns a ViewController instead of void | |
| })) | |
| //alternative action | |
| /*alert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: { action in |