This file contains hidden or 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
#!/usr/bin/env bash | |
GIT_SCRIPT=$(which -a git | sed -n 2p) | |
# Does the remote "origin" point to GitHub? | |
if ("$GIT_SCRIPT" remote -v 2>/dev/null | | |
grep '^origin\b.*github.com.*(push)$' >/dev/null 2>&1); then | |
# Yes. Set username and email that you use on GitHub. | |
export GIT_AUTHOR_NAME='*** username ***' |
This file contains hidden or 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
class ImageLoader { | |
DEFAULT_MAX_ATTEMPTS = 10; | |
DEFAULT_RELOAD_DELAY = 1000; | |
delay; | |
maxAttempts; | |
constructor(options) { | |
if (typeof options === 'undefined') { | |
options = {}; |
This file contains hidden or 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
# Run the command on the terminal | |
sudo kill -9 $(ps aux | grep coreaudiod | grep sbin | awk '{print $2}') |
This file contains hidden or 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
# List users that are already logged in | |
ps aux | grep loginwindow | grep -v grep | awk {'print $1'} | |
# Remove the session from the logged the user | |
# Be aware that the user might lose everything unsaved from their session | |
sudo kill -9 $(ps aux | grep the-chosen-user | grep loginwindow | grep -v grep | awk {'print $2'}) |
This file contains hidden or 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
package structs | |
import ( | |
"encoding/json" | |
"reflect" | |
) | |
func ConvertToMapViaReflection(s interface{}) map[string]interface{} { | |
var m map[string]interface{} |
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
final class AESEncrypt | |
{ | |
private const CYPHER_ALGO = 'AES-256-CBC'; | |
public function __construct(private readonly string $passPhrase) | |
{ |