Skip to content

Instantly share code, notes, and snippets.

@handstandsam
handstandsam / SSLHandshakeInterceptor.java
Created April 7, 2017 17:57
OkHttp 3 SSL Handshake Interceptor - Prints TLS Version & Cipher Suite Used
import android.util.Log;
import java.io.IOException;
import okhttp3.CipherSuite;
import okhttp3.Handshake;
import okhttp3.Response;
import okhttp3.TlsVersion;
/** Prints TLS Version and Cipher Suite for SSL Calls through OkHttp3 */
public class SSLHandshakeInterceptor implements okhttp3.Interceptor {
@jthodge
jthodge / universal-switcher
Created September 6, 2020 22:07
Show macOS app switcher across all monitors
defaults write com.apple.Dock appswitcher-all-displays -bool true
killall Dock
@huazhanshen
huazhanshen / 免费申请edu邮箱+谷歌无限量网盘+office365学生版教程
Created June 20, 2018 07:02
免费申请edu邮箱+谷歌无限量网盘+office365学生版教程
谷歌教育邮箱,可申请1EB网盘和开通微软Office365教育版,能用在线版Office,以及微软的OneDrive网盘.
全程特殊网络,全程PC操作,手机操作可能出现奇怪问题。
1.get美区虚拟身份:
[http://t.cn/REMDIU2](http://t.cn/REMDIU2)
或者用:
[http://suo.im/3dL5kG](http://suo.im/3dL5kG)
@DanaEpp
DanaEpp / setup_vpn.sh
Created May 12, 2021 22:26
My disposable VPN script I use during external #redteam engagements
#!/bin/bash
# Author: Dana Epp (@danaepp)
GROUP_NAME="DisposableVPN"
VM_NAME="DisposableVPN"
REGION="canadacentral"
PORT="51820"
echo "Creating resource group '$GROUP_NAME'..."
@jplhomer
jplhomer / disable-comments.sh
Created February 25, 2015 16:38
Disable all comments/pings in WordPress with WP-CLI
$ wp post list --format=ids | xargs wp post update --comment_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...
@benbjurstrom
benbjurstrom / Code.gs
Last active May 6, 2024 10:05
PurgeOldEmails
/*
|--------------------------------------------------------------------------
| PurgeOldEmails
|--------------------------------------------------------------------------
| https://gist.github.com/benbjurstrom/00cdfdb24e39c59c124e812d5effa39a
|
*/
// Purge messages automatically after how many days?
var DELETE_AFTER_DAYS = 7
@sroebert
sroebert / LockableViewExample.swift
Created September 8, 2023 22:08
SwiftUI LockableView
import SwiftUI
import UIKit
struct ContentView: View {
@State private var isLocked = false
@State private var isSheetVisible = false
var body: some View {
LockableView(isLocked: isLocked) {
@chranderson
chranderson / nvmCommands.js
Last active May 6, 2024 10:00
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@maratori
maratori / golang-mocks.md
Last active May 6, 2024 09:59
Comparison of golang mocking libraries

Comparison of golang mocking libraries

Updated 2024-04-21

Uber
[gomock][6]
[testify][2] + [mockery][3] [minimock][4] [moq][5] Google
[gomock][1]

Library

GitHub stars [![s6]][6] [![s2]][2] + [![s3]][3] [![s4]][4] [![s5]][5] [![s1]][1]
Latest release date [![d6]][r6] [![d2]][r2] + [![d3]][r3] [![d4]][r4] [![d5]][r5] [![d1]][r1]
Maintained :white_check
@Faq
Faq / gist:8821c5fd18dd01da4f80d7435158096d
Last active May 6, 2024 09:59
Install chrome & chromedriver for Docker image 2022
Source: https://gist.github.com/varyonic/dea40abcf3dd891d204ef235c6e8dd79
Change log:
1. replaced "dl-ssl.google.com" with "dl.google.com" according https://www.google.com/linuxrepositories/
2. replaced "apt-key" as "Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))."
3. use https
Oneliner for Dockerfile:
RUN set -ex; \