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 function | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" |
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
Show hidden characters
{ | |
"presets":[ | |
"@babel/preset-react", | |
"@babel/preset-env", | |
"@babel/preset-flow" | |
] | |
} |
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
{ | |
"presets":[ | |
"@babel/preset-react", | |
"@babel/preset-env", | |
"@babel/preset-flow" | |
] | |
} |
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
# Minimal webpack.config.js | |
module.exports = { | |
mode: "production", | |
entry: { | |
"app": "./src/index.js", | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.css$/, |
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
import "github.com/frikky/firestore-rollback-go" | |
// This is our self-defined fields. | |
// FirestoreEvent.Value.Fields = User | |
type User struct { | |
Username rollback.StringValue `json:"userId"` | |
Email rollback.StringValue `json:"email"` | |
DateEdited rollback.IntegerValue `json:"date_edited"` | |
} |
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
// Handles the rollback to a previous document | |
func handleRollbackUser(ctx context.Context, e FirestoreEvent) error { | |
// This can be grabbed from split of e.OldValue.Name | |
clientDoc := client.Collection("users").Doc(strings.Split(e.OldValue.Name, "/")[6]) | |
// Again, you have to | |
type NewUser struct { | |
Username string `json:"userId"` | |
Email string `json:"email"` | |
DateEdited int64 `json:"date_edited"` |
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 user | |
import ( | |
"context" | |
"errors" | |
"log" | |
"time" | |
"cloud.google.com/go/firestore" | |
) |
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
import requests | |
def screenshot(username, password, takedownurl, proxies): | |
if not isinstance(proxies, list) or len(proxies) == 0: | |
print("Proxies should be a list of countrynames e.g. [us,en]") | |
return "" | |
if len(username) == 0 or len(password) == 0: | |
print("Username and password has to be defined") | |
return "" |
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 main | |
import ( | |
"log" | |
"context" | |
"fmt" | |
"github.com/docker/docker/client" | |
natting "github.com/docker/go-connections/nat" | |
"github.com/docker/docker/api/types/container" |
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 main | |
import ( | |
"log" | |
"fmt" | |
"context" | |
"github.com/docker/docker/api/types" | |
"github.com/docker/docker/client" | |
) |
NewerOlder