Skip to content

Instantly share code, notes, and snippets.

David Truxall davetrux

Block or report user

Report or block davetrux

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Darkmode.js
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
// dark mode
console.log('dark mode')
davetrux /
Created Aug 23, 2019
SELinux allow Localhost for nginx to reverse proxy docker containers
sudo setsebool httpd_can_network_connect 1 -P
davetrux / hideshow
Created Nov 29, 2017
Mac Hide/Show Hidden Files
View hideshow
## Put these in your .bash_profile found in your home directory
## in the terminal type source ~/.bash_profile to reload your profile to make them immediately usable or close and re-open Terminal
# Hide and show hidden files in Finder windows
alias showFiles='defaults write AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/'
alias hideFiles='defaults write AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/'
davetrux / build.gradle
Created Aug 3, 2016
Gradle-Openbakery BundleId Switch
View build.gradle
if(buildType == "AppStore") {
infoplist {
bundleIdentifier = "com.hpe.appstore"
signing {
mobileProvisionURI = 'file://' + currentPath + appStoreProfile
certificateURI = "file://" + currentPath + appStoreCert
certificatePassword = certPassword
davetrux /
Created Nov 18, 2015
BBEdit TextFilter for formatting JSON
python -m json.tool
View hmac use.swift
import Foundation
func getHmacValue()-> String {
let data = "Message"
let result = data.digestHMac256("secret")
return result
davetrux / hmac.swift
Last active Nov 8, 2016
HMAC algorithm for iOS
View hmac.swift
import Foundation
//You have to create a bridging header in your project containing:
// #import <CommonCrypto/CommonHMAC.h>
extension String {
func digestHMac256(key: String) -> String! {
let str = self.cStringUsingEncoding(NSUTF8StringEncoding)
View psc - Process List Script
set cmd = 'ps axo pid,ppid,user,command'
if ("$1" == "") then
$cmd | grep "$1" | grep -v "grep $1" | grep -v "bin/psc"
View Profile
alias ll="ls -lahL"
alias con="tail -40 -f /var/log/system.log"
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
You can’t perform that action at this time.