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
# Remember, all of these commands need executed via Powershell that is started/opened with "Run As Administrator". | |
# Disabling Hyper-V | |
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor | |
# Enabling Hyper-V | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All |
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 ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func main() { | |
counts := make(map[string]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
echo "The first parameter $1" | |
echo "The second parameter is $2" | |
echo "The \$0 parametere returns the name of the file! This file is named $0." |
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
var findemCmd = &cobra.Command{ | |
Use: "findem", | |
Short: "A brief description of your command", | |
Long: `A longer description that spans multiple lines and likely contains examples | |
and usage of using your command. For example: | |
Cobra is a CLI library for Go that empowers applications. | |
This application is a tool to generate the needed files | |
to quickly create a Cobra application.`, | |
Run: func(cmd *cobra.Command, args []string) { |
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
func getBearerToken(consumerKey, consumerSecret string) (string, error) { | |
req, err := http.NewRequest("POST", "https://api.twitter.com/oauth2/token", | |
strings.NewReader("grant_type=client_credentials")) | |
if err != nil { | |
return "", fmt.Errorf("cannot create /token request: %+v", err) | |
} | |
b64Token := base64.StdEncoding.EncodeToString( | |
[]byte(fmt.Sprintf("%s:%s", consumerKey, consumerSecret))) |
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
func buildTwitterList() []string { | |
theFile := viper.GetString("file") | |
theTwitterers, err := ioutil.ReadFile(theFile) | |
check(err) | |
stringTwitterers := string(theTwitterers[:]) | |
splitFields := strings.Fields(stringTwitterers) | |
var completedTwittererList []string | |
for _, aField := range splitFields { | |
if strings.HasPrefix(aField, "@") && aField != "@" { | |
reg, _ := regexp.Compile("[^a-zA-Z0-9_@]") |
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
var parseCmd = &cobra.Command{ | |
Use: "parse", | |
Short: "This command will extract the Twitter Accounts form a text file.", | |
Long: `This command will extract the Twitter Accounts and clean up or disregard other characters | |
or text around the twitter accounts to create a simple, clean, Twitter Accounts only list.`, | |
Run: func(cmd *cobra.Command, args []string) { | |
completedTwittererList := buildTwitterList() | |
fmt.Println(completedTwittererList) | |
if viper.Get("fileExport") != nil { | |
exportParsedTwitterList(viper.GetString("fileExport"), viper.GetString("fileFormat"), completedTwittererList) |
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
var configCmd = &cobra.Command{ | |
Use: "config", | |
Short: "A brief description of your command", | |
Long: `A longer description that spans multiple lines and likely contains examples | |
and usage of using your command. For the custom example: | |
Cobra is a CLI library for Go that empowers applications. | |
This application is a tool to generate the needed files | |
to quickly create a Cobra application.`, | |
Run: func(cmd *cobra.Command, args []string) { | |
fmt.Printf("Twitterers File: %s\n", viper.GetString("file")) |
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
class ShoppingList extends React.Component { | |
render() { | |
return ( | |
<div className="shopping-list"> | |
<h1>Shopping List for {this.props.name}</h1> | |
<ul> | |
<li>Instagram</li> | |
<li>WhatsApp</li> | |
<li>Oculus</li> | |
</ul> |
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
<script src="https://unpkg.com/vue"></script> | |
<div id="app"> | |
<p id="hello">{{ message }} hi!</p> | |
</div> | |
<script> | |
new Vue({ | |
el: '#app', | |
data: { |