Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jaredmdobson's full-sized avatar
🤚
Hi

Jared Dobson jaredmdobson

🤚
Hi
  • Cedar City, UT
View GitHub Profile
@jaredmdobson
jaredmdobson / SafeTextField.kt
Created May 25, 2022 19:55
Prevent DEL Button crashing on jetpack compose android textfield
@Composable
fun SafeTextField(modifier = Modifier){
TextField(
modifier = modifier.onPreviewKeyEvent {
it.nativeKeyEvent.keyCode == KeyEvent.KEYCODE_DEL
}
)
@jaredmdobson
jaredmdobson / gist:5a94fb2a43157953d017fc2dd0fdd03e
Created April 29, 2021 14:26
Find out which certificate a macos was signed with.
codesign -d --extract-certificates ./[App Name Here].app;
openssl x509 -inform DER -in codesign0 -out codesign0.pem;
openssl x509 -inform DER -in codesign1 -out codesign1.pem;
openssl x509 -inform DER -in codesign2 -out codesign2.pem;
cat codesign1.pem codesign2.pem > cachain.pem;
openssl x509 -inform DER -in codesign0 -noout -nameopt -oneline -subject -serial -dates;
@jaredmdobson
jaredmdobson / gist:1da04297140e07fdfebb2b42def9e94a
Created March 2, 2021 17:42
Localhost and domain only regex
/^((\b(localhost)\b:[0-9]+)|([a-z0-9][a-z0-9-]{1,61}[a-z0-9](?:\.[a-z]{2,})+(:[0-9]+)?))$/
@jaredmdobson
jaredmdobson / sp_queryplan.sql
Created January 13, 2012 01:50
SQL Server 2008 Shows Execution Plan for a given spid.
--=====================================================
-- Author: Jared Dobson
-- Date: 12/22/2010
-- Description: Shows Execution Plan for a given spid.
--=====================================================
CREATE PROCEDURE sp_queryplan ( @SessionID INT )
AS
BEGIN
SELECT
[DEQP].[query_plan],
@jaredmdobson
jaredmdobson / upgrade-jenkins.sh
Last active June 14, 2018 17:27 — forked from cyxou/upgrade-jenkins.sh
Upgrade Jenkins on Bitnami VM
#!/bin/bash
sudo /opt/bitnami/ctlscript.sh stop tomcat
cd /opt/bitnami
sudo cp -f apache-tomcat/webapps/jenkins.war apps/jenkins/jenkins.war.bak
sudo rm -r apache-tomcat/webapps/jenkins
sudo rm -r apache-tomcat/webapps/jenkins.war
sudo rm -r apache-tomcat/work/Catalina/localhost/jenkins
sudo wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
sudo mv jenkins.war apache-tomcat/webapps/
@jaredmdobson
jaredmdobson / sp_helpindex3.sql
Last active May 30, 2018 21:29
T-SQL sp_helpindex3 replaces sp_helpindex2
USE master
GO
IF OBJECT_ID('sp_helpindex2', 'P') IS NOT NULL
BEGIN
DROP PROCEDURE sp_helpindex2
END
IF OBJECT_ID('sp_helpindex3', 'P') IS NOT NULL
BEGIN
DROP PROCEDURE sp_helpindex3
END
@jaredmdobson
jaredmdobson / launch.json
Last active April 9, 2018 04:24
VS Code Rust LLDB Debug Launch.json 2018
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "lldb",
@jaredmdobson
jaredmdobson / tasks.json
Created April 9, 2018 04:24
VS Code Rust Cargo Tasks 2018
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
"version": "0.1.0",
"command": "cargo",
@jaredmdobson
jaredmdobson / EnableAllTriggers.sql
Created January 13, 2012 01:48
T-SQL Enable All Triggers
CREATE PROCEDURE [dbo].[EnableAllTriggers]
AS
DECLARE @string VARCHAR(8000)
DECLARE @tableName NVARCHAR(500)
DECLARE cur CURSOR