Skip to content

Instantly share code, notes, and snippets.

View robertpainsi's full-sized avatar

Robert Painsi robertpainsi

View GitHub Profile
import java.math.BigDecimal;
public class CatrobatVersionNumberExceededTest {
public static void main(String[] args) {
int append = 1;
String base = "0.";
while (true) {
String versionAsText = base + append;
float version = Float.parseFloat(versionAsText);
@robertpainsi
robertpainsi / wordpress-default-email.php
Last active October 17, 2019 10:35
WordPress - Use from email if specified in header, else fall back to default
<?php
function my_from_name( $name ) {
if ( $name === 'WordPress' ) {
return 'Default Sender';
} else {
return $name;
}
}
@robertpainsi
robertpainsi / emojis.md
Last active January 16, 2020 16:14
Random emoji collection
GitHub Emojis id
   :point_down:
👉  👈
    :point_up_2:
1
🐑💨 2
🐐💨 3
🎩
🐨
4
   :zap:
🔦
5
    :cloud:
    :umbrella:
6
🎩
🐸
👔
7
🎷🐜 8
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active April 19, 2024 12:48
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@robertpainsi
robertpainsi / README.md
Last active March 21, 2024 10:45
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@robertpainsi
robertpainsi / .gitconfig
Last active December 1, 2022 20:05
.gitconfig
[branch]
autosetupmerge = true
[core]
editor = gedit --wait --new-window
pager = less -x1,5
whitespace = trailing-space,space-before-tab,tabwidth=4
[color]
ui = auto