Skip to content

Instantly share code, notes, and snippets.

View jaredallard's full-sized avatar
:shipit:

Jared Allard jaredallard

:shipit:
View GitHub Profile
@mb-tmatsuoka
mb-tmatsuoka / __svn_ps1.sh
Created August 20, 2012 02:06
define __svn_ps1 like __git_ps1
__svn_ps1() {
if [[ -d .svn ]]; then
local url=$(svn info | awk '/URL:/ {print $2}')
local repo=$(echo $url | sed 's/^.*\/\(trunk\|branches\|tags\)/\1/')
if $SVN_PS1_SHOWDIRTYSTATE; then
svn st | grep -e '^[MA]' > /dev/null 2>&1
local modified=$(echo $? | sed 's/0/+/' | sed 's/1//')
svn st | grep '^?' > /dev/null 2>&1
local added=$(echo $? | sed 's/0/*/' | sed 's/1//')
fi
@ericelliott
ericelliott / defaults-overrides.md
Last active May 7, 2023 13:52
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {
@Neo23x0
Neo23x0 / nmap-cmdline
Last active March 19, 2020 17:10
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
#
# 1. Use @calderpwn's script
# http://seclists.org/nmap-dev/2017/q2/79
#
# 2. Save it to Nmap NSE script directory
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/
# OSX - /opt/local/share/nmap/scripts/
#
@nicbou
nicbou / ChromeCastService.js
Created November 20, 2017 22:04
[JS] How to send videos with subtitles to a ChromeCast device
class ChromeCastService {
constructor() {
this.castSession = null;
this.sessionRequest = new chrome.cast.SessionRequest(chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID);
const apiConfig = new chrome.cast.ApiConfig(
this.sessionRequest,
(session) => { // sessionListener
console.log('Received ChromeCast session', session)
this.castSession = session;
@HacKanCuBa
HacKanCuBa / sshd_config
Last active May 16, 2022 22:33
Modern secure SSH daemon config
# Modern secure (OpenSSH Server 7+) SSHd config by HacKan
# Refer to the manual for more info: https://www.freebsd.org/cgi/man.cgi?sshd_config(5)
# Server fingerprint
# Regenerate with: ssh-keygen -o -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa -b 4096
HostKey /etc/ssh/ssh_host_rsa_key
# Regerate with: ssh-keygen -o -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
HostKey /etc/ssh/ssh_host_ed25519_key
# Log for audit, even users' key fingerprint
! 5/3/2018, 9:36:51 AM https://twitter.com/
twitter.com##.has-content.roaming-module.js-wtf-module.wtf-module.module
! 5/3/2018, 9:37:01 AM https://twitter.com/
twitter.com##.trends.Trends.module
! 5/3/2018, 9:37:09 AM https://twitter.com/
twitter.com##.js-moments-tab.moments > .js-dynamic-tooltip.js-tooltip.js-nav