Skip to content

Instantly share code, notes, and snippets.

View SeanChristopherConway's full-sized avatar

Sean Conway SeanChristopherConway

  • Programmer
  • Sherwood Park, AB, Canada
View GitHub Profile
buf, bodyErr := ioutil.ReadAll(r.Body)
if bodyErr != nil {
log.Print("bodyErr ", bodyErr.Error())
http.Error(w, bodyErr.Error(), http.StatusInternalServerError)
return
}
rdr1 := ioutil.NopCloser(bytes.NewBuffer(buf))
rdr2 := ioutil.NopCloser(bytes.NewBuffer(buf))
log.Printf("BODY: %q", rdr1)
@SeanChristopherConway
SeanChristopherConway / GoogleIDToken.go
Created September 25, 2020 04:35 — forked from salrashid123/GoogleIDToken.go
Google ID Tokens with Golang
package main
import (
"context"
"io/ioutil"
"log"
"net/http"
"google.golang.org/api/idtoken"
)
@SeanChristopherConway
SeanChristopherConway / curl_post_json.md
Created September 25, 2020 04:30 — forked from ungoldman/curl_post_json.md
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@SeanChristopherConway
SeanChristopherConway / wsl-go-install.sh
Created August 31, 2020 19:00
Script to install Go 1.8.3 on Linux and WSL (Windows Subsystem for Linux)
#!/bin/bash
set -e
GVERSION="1.8.3"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/projects/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directories already exist $GOROOT"

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@SeanChristopherConway
SeanChristopherConway / babelInterpreter.sh
Created February 21, 2018 06:08 — forked from cagataycali/babelInterpreter.sh
Start pm2 process with babel-node interpreter
pm2 start app.js --interpreter ./node_modules/.bin/babel-node
@SeanChristopherConway
SeanChristopherConway / git-overwrite-branch.sh
Created January 29, 2018 19:47 — forked from ummahusla/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
@SeanChristopherConway
SeanChristopherConway / save_file.js
Created September 23, 2017 20:56 — forked from timoa/save_file.js
Save file iOS and Android with Appcelerator Titanium Mobile SDK (http://timoa.com/en/2012/07/appcelerator-nativepath-on-ios-and-android/)
// OS
if(Ti.Platform.osname === 'iPhone' || Ti.Platform.osname === 'iPad') {
var ios = true;
}
/**
* Save file function
*
* @file: Binary file (Blob)
* @filename: Name of file (String)