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 { IncomingMessage } from 'http'; | |
import { TLSSocket } from 'tls'; | |
import { URL } from 'url'; | |
export function parseRequestUrl(req: IncomingMessage) { | |
let protocol = 'http'; | |
if ((req.socket as TLSSocket).encrypted) { | |
protocol = 'https'; | |
} |
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 ( | |
"bytes" | |
"context" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"strconv" |
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 net = require("net"); | |
process.on("uncaughtException", function(error) { | |
console.error(error); | |
}); | |
if (process.argv.length != 5) { | |
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]); | |
process.exit(); | |
} |
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 | |
curl http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz -O | |
tar xvzf llvm-6.0.0.src.tar.xz | |
rm llvm-6.0.0.src.tar.xz | |
cd llvm-6.0.0.src | |
# get clang | |
pushd tools | |
curl http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz -O |
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 -e | |
uuid="$(uuidgen)" | |
echo "New Keychain name: $uuid" | |
keychains=$(security list-keychains -d user) | |
keychainNames=(); |
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 | |
set -x | |
USAGE() { | |
cat << EOF | |
Usage: ${0##*/} <-i ident.p12> [-p password] <-m profile.mobileprovision> [-a com.example.app] [-n NewName] [-I Info.plist] | |
-i ident.p12 The signing identity file. | |
-p password The password of signing identity file. | |
-m profile.mobileprovision Signing provision profile | |
-a com.example.app Override CFBundleIdentifier |
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 ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"errors" | |
"io" | |
"io/ioutil" |