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
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { | |
// dark mode | |
console.log('dark mode') | |
} |
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
sudo setsebool httpd_can_network_connect 1 -P |
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
## 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 com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' | |
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' |
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
if(buildType == "AppStore") { | |
infoplist { | |
bundleIdentifier = "com.hpe.appstore" | |
} | |
signing { | |
mobileProvisionURI = 'file://' + currentPath + appStoreProfile | |
certificateURI = "file://" + currentPath + appStoreCert | |
certificatePassword = certPassword | |
} |
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/sh | |
python -m json.tool |
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
alias ll='ls -al' |
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 Foundation | |
func getHmacValue()-> String { | |
let data = "Message" | |
let result = data.digestHMac256("secret") | |
return result | |
} |
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 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) |
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/tcsh | |
set cmd = 'ps axo pid,ppid,user,command' | |
if ("$1" == "") then | |
$cmd | |
else | |
$cmd | grep "$1" | grep -v "grep $1" | grep -v "bin/psc" | |
endif |
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
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' |
NewerOlder