| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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
| # Get VNC Server running on Google Cloud with Ubuntu 18.04 | |
| [Create a new Google Clound Instance](https://console.cloud.google.com/compute/instances?project=tenso-flow&folder&organizationId&duration=PT1H) | |
| ## Install a Desktop | |
| In this case ubuntu-desktop | |
| ### Install Tasksel | |
| ` | |
| sudo apt-get install aptitude tasksel | |
| ` |
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 args = ['node', '--proxy=']; | |
| const flags = ['proxy']; | |
| let hasProxy = (arg) => flags.find(flag => arg.includes(flag)); | |
| if(args.find(hasProxy)) { | |
| console.log("proxy"); | |
| } else { | |
| console.log("error"); | |
| } |
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
| function countCSSRules() { | |
| var results = '', | |
| log = ''; | |
| if (!document.styleSheets) { | |
| return; | |
| } | |
| for (var i = 0; i < document.styleSheets.length; i++) { | |
| countSheet(document.styleSheets[i]); | |
| } | |
| function countSheet(sheet) { |
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
| # setup data | |
| data1 = {1 => %W{ A B C D E} , 2 => %W{ A B C D E }, 3 => %W{ A B C D E }, 4 => %W{ A B C D E } } | |
| list = data1[1] | |
| def swap_list_values_to_keys(key, list) | |
| list.reduce({}) { |a, value| a.merge({key => value.downcase}.invert) } | |
| end | |
| # p swap_list_values_to_keys(1, list) | |
| # => {"a"=>1, "b"=>1, "c"=>1, "d"=>1, "e"=>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
| // `unit` is `return` from Haskell | |
| // `bind` is `>>=` from Haskell, or `flatMap` from Scala | |
| var None = { | |
| bind: function (fn) { return this; }, | |
| unit: function (v) { return Option(v); }, | |
| getOrElse: function (elseValue) { return elseValue; } | |
| }; | |
| var Some = function (value) { |
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
| // packages | |
| //----------------------- | |
| // alignment | |
| // ruby-eval | |
| // sublime linter | |
| // origami | |
| // autofilename | |
| // javascript es6 syntax highlighting | |
| // gutter color | |
| // git gutter |
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
| abbr[title]:after // after an abbr element with title attribute | |
| { | |
| content: " (" attr(title) ")"; // display the title attribute value in parentheses | |
| } | |
| @media screen and (min-width: 1025px) // above 1025px screen width | |
| { | |
| abbr[title] | |
| { | |
| border-bottom: 1px dashed #ADADAD; // draw a dashed border under the abbr element |
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
| # Rspec Syntax Cheat Sheet | |
| ## Stub: | |
| Replacing a method with code that returns a specified result. | |
| weapon.stub(:slice) | |
| Stubbing to avoid hitting database | |
| Before: context block hits DB twice |
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
| ### Add RVM to PATH for scripting | |
| PATH=$PATH:$HOME/.rvm/bin | |
| ### Add bin to my PATH | |
| PATH=$HOME/bin:$PATH | |
| ### Added by the Heroku Toolbelt | |
| export PATH="/usr/local/heroku/bin:$PATH" |