Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 9, 2024 13:51
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

class Solution:
def isPalindrome(self, x: int) -> bool:
if x < 0:
return False
xcopy = x
reverse = 0
while xcopy > 0:
reverse = (reverse * 10) + (xcopy % 10)
@onamfc
onamfc / AccessToken.php
Last active May 9, 2024 13:50
Add Custom Claims to Passport 8 / Laravel 6
<?php
namespace App\Passport;
use App\User;
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Key;
use League\OAuth2\Server\CryptKey;
use Lcobucci\JWT\Signer\Rsa\Sha256;
use Laravel\Passport\Bridge\AccessToken as BaseToken;
@parmentf
parmentf / GitCommitEmoji.md
Last active May 9, 2024 13:47
Git Commit message Emoji
@stared
stared / software_for_scientists.md
Last active May 9, 2024 13:46
Software for scientists: community-edited list of general-purpose software for scientists.

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

in General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.

@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 9, 2024 13:46
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@fuckup1337
fuckup1337 / JavascriptRecon.md
Created January 18, 2021 20:02
My Javascript Recon Process - BugBounty

Description

This is a simple guide to perform javascript recon in the bugbounty

Steps

  • The first step is to collect possibly several javascript files (more files = more paths,parameters -> more vulns)
@Razenbull
Razenbull / google_place_autocomplete.js
Last active May 9, 2024 13:42
google place autocomplete && select first option on enter if !$(".pac-item-selected")
var $addressInput = $('#locationAddressInput');
var setKeyDownListener = selectFirstOptionOnEnter($addressInput[0]);
window.autocomplete = new google.maps.places.Autocomplete($addressInput[0], {
type: ['geocode'],
componentRestrictions: {country: 'be'}
});
google.maps.event.addListener(window.autocomplete, 'place_changed', function () {
var address = window.autocomplete.getPlace();