xtapa

joined 1 year ago
[–] [email protected] 11 points 6 days ago

Papers please should be playable with one hand only and is great at burning time

[–] [email protected] 4 points 1 week ago

Looks great, thanks!

[–] [email protected] 21 points 1 week ago (2 children)

I think this level of derailing in a post about trains is irresponsible.

[–] [email protected] 2 points 3 weeks ago* (last edited 3 weeks ago)

I personally try to avoid deeply nested if/else. Or else in general, because I think it makes code more readable. Especially when one of the branches is just an exit condition.

if exitCondition {
    return false
}
// long ass code execution

is way more readable than

if !exitCondition {
    // long ass code execution
} else {
   return false
}

In a loop, you can just return the value instead of passing it to a "retVal" variable.

With those in mind, you could refactor HasPermissions to

func (r *RBAC) HasPermission(assignedRoles []string, requiredPermission string, visited map[string]bool) bool {
	for _, assigned := range assignedRoles {
		if visited[assigned] {
			continue
		}
		role, ok := r.Roles[assigned]
		if !ok {
			//role does not exist, so skip it
			continue
		}
		for _, permission := range role.Permissions {
			if permission.String() == requiredPermission {
				//Permission has been found! Set permitted to true and bust out of the loop
				return true
			}
		}
		//check inherited roles
		if permitted := r.HasPermission(role.Inherits, requiredPermission, visited); permitted {
			return true
		}
	}
	return false
}

The same could be applied to LoadJSONFile and I think that really would approve the readability and maintainability of your code.

edit: This refactor is not tested

[–] [email protected] 6 points 2 months ago

Add Shape shifting and you're Ranma.

[–] [email protected] 3 points 2 months ago

That wouldn't exclude Cyberpunk for example.

[–] [email protected] 2 points 2 months ago

They usually were not pointy and heavier than regular swords which made it easier to chop off body parts.

[–] [email protected] 2 points 3 months ago (1 children)

Just get a Bakfiets.

1
Pro Linux hacking (discuss.tchncs.de)
 

Found some very special "make it look hacky" bash in criminal minds.

[–] [email protected] 14 points 3 months ago

I don't think he's anywhere near to having sex.

[–] [email protected] 11 points 4 months ago (1 children)

Well, the cheese in Mac and cheese usually isn't cheese either, tbf.

[–] [email protected] 11 points 5 months ago (1 children)

Every shooter that allows custom maps from the late 90s and early 00s has a map resembling Columbine. If your reason to not make a game is because someone might turn it into something horrible, there would probably be no games.

 

cross-posted from: https://discuss.tchncs.de/post/20478370

cross-posted from: https://discuss.tchncs.de/post/20474285

I've been trying tmux and followed a video that showcases and offers a prebuilt config for styling and plugins. Something happended (guess I did something wrong?) the styling broke and I decided I'll go bare bones and customize to my needs when needed instead of using preconfigured stuff. I deleted all configs and caches I could find with fzf and even reinstalled tmux, but still some broken styling is present and makes it unpleasent to work with. Some of my configs seem to be present even after uninstall, as the prefix is still C-Space instead of the default. There are some oh-my-zsh subfolders that contain tmux. I don't know if those have been there before and I also don't know, if I can delete them without breaking the next thing.

I'm on a MacBook and installed tmux via brew.

 

I've been trying tmux and followed a video that showcases and offers a prebuilt config for styling and plugins. Something happended (guess I did something wrong?) the styling broke and I decided I'll go bare bones and customize to my needs when needed instead of using preconfigured stuff. I deleted all configs and caches I could find with fzf and even reinstalled tmux, but still some broken styling is present and makes it unpleasent to work with. Some of my configs seem to be present even after uninstall, as the prefix is still C-Space instead of the default. There are some oh-my-zsh subfolders that contain tmux. I don't know if those have been there before and I also don't know, if I can delete them without breaking the next thing.

I'm on a MacBook and installed tmux via brew.

8
Uninstall iterm2 for good (discuss.tchncs.de)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Hi,

I'm trying to uninstall iterm2. I installed it via the installer from their webpage and tried to uninstall it by putting the application in the bin as usual. But it keeps reappearing. I also tried removing remaining files: "~/Library/Application Support/iTerm", "~/Library/Application Support/iTerm2", "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.googlecode.iterm2.sfl*", "~/Library/Caches/com.googlecode.iterm2", "~/Library/Cookies/com.googlecode.iterm2.binarycookies", "~/Library/Preferences/com.googlecode.iterm2.plist", "~/Library/Saved Application State/com.googlecode.iterm2.savedState",

Still, iterm will pop up as soon as I start my mac. What is this shit? How can I get rid of it?

Answer: "This shit" is my stupid brain. I forgot I reinstalled iterm after my employer introduced a managed software center. It was the only app I installed via msc myself and thus did not think of it at first.

 

Hi,

I'm in the weird spot again, where I want to update my Tumbleweed system and am lost in a dependency hell. It more or less occurs once in a while when updates drop and the prompt asks if I want to install stuff from vendor "obs://build.opensuse.org/home:wolfi323" replacing the obsolete stuff from the official openSUSE vendor.

As soon as I read wolfi323, I get fucking Vietnam flashbacks, because it means I will have to decide for ~100 services if I keep the current obsolote version or install the one from wolfi323. Either way, it's gonna fuck up a myriad of dependencies.

All that hassle just to do the same shit all over again because at some point, the official opensuse repos catch up with newer versions.

I could probably wait for the official updates, but it's uncertain, when they are going to drop and I'll just pile up thousands of updates in the meantime.

How do the Tumbleweed Folks among us deal with this?

 

I just noticed, that my SSD is almost full and I think it is because of all the zypper packages I got installed. I've got another ~100gb SSD thats just for stuff (mounted unter "Misc" says it all) and would like to move some (or all?) of the packages like vscode, podman or other stuff on that second SSD. Is there a way to do that with zypper without removing and installing them again under the new path?

view more: next ›