This file contains 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
# prevent vim from losing colors | |
# set -g default-terminal "xterm" | |
set -g default-terminal "screen-256color" | |
tmux_conf_theme_24b_colour=true | |
tmux_conf_theme_focused_pane_bg='default' | |
tmux_conf_theme_pane_border_style=thin | |
tmux_conf_theme_left_separator_main='\uE0B0' | |
tmux_conf_theme_left_separator_sub='\uE0B1' | |
tmux_conf_theme_right_separator_main='\uE0B2' |
This file contains 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 main | |
import ( | |
"fmt" | |
"net" | |
"strings" | |
"time" | |
"github.com/fatih/color" | |
"github.com/google/go-cmp/cmp" |
This file contains 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 main | |
import ( | |
"archive/tar" | |
"bytes" | |
"compress/gzip" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" |
This file contains 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 main | |
import ( | |
"fmt" | |
"strings" | |
) | |
var ( | |
app = `db.username=hello | |
db.password=world |
This file contains 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 main | |
import ( | |
"encoding/json" | |
"fmt" | |
"os" | |
) | |
type NotificationState int |
This file contains 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 main | |
// Here we show how to properly terminate multiple go routines by using a context. | |
// Thanks to WaitGroup we'll be able to end all go routines gracefully before the main function ends. | |
import ( | |
"context" | |
"fmt" | |
"math/rand" | |
"os" |
This file contains 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
#!/bin/bash | |
LENGTH=25 | |
if [ ! -z "$1" ] && [ $1 -gt 1 ]; then | |
LENGTH=$1 | |
fi | |
NUMBYTES=`echo $LENGTH | awk '{print int($1*1.16)+1}'` | |
openssl rand -base64 $NUMBYTES | tr -d "=+/" | cut -c1-$LENGTH |
This file contains 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
import React, { useReducer, useEffect, useContext, createContext } from "react"; | |
import "./App.css"; | |
import { | |
BrowserRouter as Router, | |
Switch, | |
Route, | |
Link, | |
useParams, | |
} from "react-router-dom"; |
This file contains 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
// https://gist.github.com/fracasula/b579d52daf15426e58aa133d0340ccb0 | |
// https://blog.afoolishmanifesto.com/posts/golang-concurrency-patterns/ | |
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"net/http" |
This file contains 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 main | |
import ( | |
"fmt" | |
"os" | |
"strings" | |
"github.com/spf13/cobra" | |
"github.com/spf13/viper" | |
) |