Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Painsi robertpainsi

View GitHub Profile
View CatrobatVersionNumberExceededTest.java
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 Oct 17, 2019
WordPress - Use from email if specified in header, else fall back to default
View wordpress-default-email.php
<?php
function my_from_name( $name ) {
if ( $name === 'WordPress' ) {
return 'Default Sender';
} else {
return $name;
}
}
@robertpainsi
robertpainsi / .Xmodmap
Last active Aug 14, 2018
Expand English keyboard layout (German letters, Euro Money, Simple Math, Super/Subscript numbers to easily create fractions, Arrows)
View .Xmodmap
keycode 108 = Mode_switch Mode_switch Mode_switch Mode_switch
keycode 94 = grave asciitilde
!German chars (umlauts, sharp s)
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
!Money
@robertpainsi
robertpainsi / emojis.md
Last active Jan 16, 2020
Random emoji collection
View emojis.md
GitHub Emojis id
   👇
👉  👈
    👆
1
🐑💨 2
🐐💨 3
🎩
🐨
4
   
🔦
5
    ☁️
    
6
🎩
🐸
👔
7
🎷🐜 8
View commit-message-guidelines.md

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 Mar 22, 2021
How to reopen a pull-request after a force-push?
View README.md

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 <GITHUB-HASH-FROM-STEP-2>:<PR-BRANCH>
View .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