-
Install Brew, a nice package manager for MacOS
-
Install Fish :
brew install fish
-
Add fish to the list of available shells :
sudo -s
thenecho /usr/local/bin/fish >> /etc/shells
-
(optional) Set fish as the default shell
3.1 ...for root (assumed as the current user because of point 2.) :chsh -s /usr/local/bin/fish
\
This file contains 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
/// <summary> | |
/// Get the name of the provided member. | |
/// Same as using the operatore nameof provided by C# >= 6.0. | |
/// | |
/// Usage: GetMemberName(() => myMember); | |
/// </summary> | |
/// <param name="memberExpression"></param> | |
/// <typeparam name="T"></typeparam> | |
/// <returns></returns> | |
private static string GetMemberName<T>(Expression<Func<T>> memberExpression) |
I found that the "best" way is to use HTML, as it works both in Readme/.md files and also in comments (within Issues, Gist...)
E.g. when adding/editing a comment (within Issues, Gist...) :
- Upload the picture by drag-and-drop in the text field
- replace
![image](https://your-image-url.type)
with<img src="https://your-image-url.type" width="100" height="100">
As mentioned by @cbestow (thanks!), it's not mandatory to set both width
and height
. If only one is set, the other will be adjusted accordingly to preserve the aspect ratio of the image.
This file contains 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
cd repository | |
git checkout --orphan orphan_name | |
git rm -rf . | |
rm '.gitignore' | |
echo "#Title of Readme" > README.md | |
git add README.md | |
git commit -a -m "Initial Commit" | |
git push origin orphan_name |
This file contains 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
public class UpdateIntervals : MonoBehaviour { | |
private float updateStep = 0.1f; // in seconds | |
private float currentUpdateTime = 0f; | |
void Start() {} | |
void Update() { | |
currentUpdateTime += Time.deltaTime; | |
if(currentUpdateTime > updateStep) { |
This file contains 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
/* Used for example when you get an Uri within the onActivityResult : | |
@Override | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); | |
// Process the result if it's OK (user finished the action) and the request code matches. | |
if (resultCode == RESULT_OK && requestCode == PICK_IMAGE) { | |
imageUri = data.getData(); // <==== THERE | |
//... | |
*/ |
This file contains 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
private static final int PICK_IMAGE = 1; // number that identify the request (can be any number) | |
//... | |
// Called e.g. when clicking on a button | |
public void addPicture() { | |
Intent intent = new Intent(); | |
intent.setType("image/*"); // the type of data we are interested of | |
intent.setAction(Intent.ACTION_GET_CONTENT); | |
startActivityForResult(Intent.createChooser(intent, "Select picture"), PICK_IMAGE); | |
} |
This file contains 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 getAge(dateString) { | |
var birthDate = new Date(dateString); | |
var today = new Date(); | |
var diff = today-birthDate; // Difference in milliseconds | |
var age = Math.floor(diff/31557600000); // Divide by 1000*60*60*24*365.25 <- length of a year (365 days and 6 hours) in milliseconds | |
return age; | |
} |