- http://stackoverflow.com/questions/804115 (
rebasevsmerge). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebasevsmerge) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse) - http://stackoverflow.com/questions/292357 (
pullvsfetch) - http://stackoverflow.com/questions/39651 (
stashvsbranch) - http://stackoverflow.com/questions/8358035 (
resetvscheckoutvsrevert)
Backup the API key beforehand in case you have trouble reverting the file.
Let's say the file with a key you want to hide is <filename>
Open it and change the API key with a placeholder, like <api-key>
Save and add the file to git and commit
git commit -m 'Masking API key'
Then revert the file, undoing recent changes so your key is back where it should be and save it.
Use
git update-index --assume-unchanged
| ## How to hide API keys from github ## | |
| 1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while | |
| retaining your commits: https://help.github.com/articles/remove-sensitive-data/ | |
| 2. In the terminal, create a config.js file and open it up: | |
| touch config.js | |
| atom config.js |
| // paste in your console | |
| speechSynthesis.onvoiceschanged = function() { | |
| var msg = new SpeechSynthesisUtterance(); | |
| msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0]; | |
| msg.text = Object.keys(window).join(' '); | |
| this.speak(msg); | |
| }; |
| .sap-green { | |
| background-color: #0A3410; | |
| } | |
| .sap-green-text { | |
| color: #0A3410; | |
| } | |
| .sap-green-border { | |
| border-color: #0A3410; | |
| } |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <gmp.h> | |
| char * polynomial="-74101463560860539810482394216134472786413399/404009590666424903383979388988167534591844018460526499864038804741201731572423877094984692537474105135297393596654648304117684895744000000000000000000000*x^99 + 1786563401621773217421750502452955853226339781/1943688752347061390850759947022111850270039951356484879070977067483444756705819339975871373032521468004867185688372878439054154137600000000000000000000*x^98 - 27321291157050372775340569532625689973429185264741/12024094960310264981666053243695462339042976739896622019763059664916718201560234437350734896948634081407660523709959770955883479040000000000000000000000*x^97 + 4936870031754926645682423836151042176171669450909/1336493173680525187613977630110369004256312194947800263402124063124652591386915768177479078216982141485276408003996973457735680000000000000000000000*x^96 - 24473118674386691114350902920738421254018653211816783/55093218603941649400531744530105211175454647 |
| applicators = {3 => "fizz", 5 => "buzz"} | |
| fizzbuzz = | |
| (1..100).map do |n| | |
| fb = applicators. | |
| select{|a| n % a == 0}. | |
| values.join | |
| [n.to_s, fb].max # "1" > "" and "fizz" > "100000" since "1" < "a" | |
| end | |
| puts fizzbuzz |
Issues with latex math in markdown files, for display on Github Pages (using jekyll)
Our solution: use kramdown parser, with GFM option (Github flavored Markdown). In the .Rmd, use $$ for display math and $ for inline math. then have a script which turns the inline math demarkation in the .md file from $ into $$ when appropriate (avoiding data frame usage), before uploading the .md to Github. This way, RStudio preview looks the same as the Github Pages version.
- doesn't respect
$or$$(will parse characters within these, such as_), but has workarounds: - has a useful option,
no_intra_emphasis, so underscores between ascii characters are not converted to<em>tags, so$x_1$is fine - need to escape underscores after non-ascii characters, for example
$\mathbf{x}\_1$ - need to double escape curly bracket:
\\{
| var donutChart; | |
| (function() { | |
| var width = 500, | |
| height = 300, | |
| radius = 100, | |
| innerRadius = 80, | |
| transitionsDuration = 1000, | |
| transitionsDelay = 250, | |
| percentageTextSize = '2.0rem', | |
| transitionType = 'elastic'; |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule