Skip to content

Instantly share code, notes, and snippets.

View drewsmith's full-sized avatar

Drew Smith drewsmith

  • Kansas City, MO
View GitHub Profile
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" -y
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io
@drewsmith
drewsmith / mapper.js
Last active September 19, 2018 13:14
object conversion
const importMemberObject = {
first_name: 'Jason',
last_name: 'Brady',
email_address: 'jason@email.com',
phone_number: '8167395555'
}
// will have to be hand crafted per congregation
const mappingConfig = {
Member: {
<NavBarMobile
onPusherClick={this.handlePusher}
onToggle={this.handleToggle}
rightItems={menuItems}
visible={visible}
>
{children}
</NavBarMobile>
@drewsmith
drewsmith / intellij.sh
Last active June 18, 2018 20:09
Ubuntu IntelliJ
curl https://www.jetbrains.com/idea/download/download-thanks.html?platform=linux
sudo tar xf *.tar.gz -C /opt && sudo ln -s /opt/Idea* /opt/idea
sudo echo "Version=
Type=Application
Terminal=false
Icon[en_US]=/opt/idea/bin/idea.png
Name[en_US]=IntelliJ
Exec=/opt/idea/bin/idea.sh
Name=IntelliJ
@drewsmith
drewsmith / git_graph
Created April 16, 2018 15:59
git_graph
alias git_graph=$(git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s")
@drewsmith
drewsmith / xss_test.js
Created February 8, 2018 05:02
XSS regex
var regex = /.*(script\b).*>.*<.*(script\b).*/gi;
var scripts = [
"<script> alert(); </script>",
"<< ScRiPT >alert(\"XSS\");//<</ ScRiPT >",
"<script/src=test.js></script>",
"<script src=test.js></script>",
"<div><script> alert(); </script></div>",
"<script+>alert();</script>",
"<script/script>", //valid
@drewsmith
drewsmith / .vimrc
Last active January 16, 2018 04:44
.vimrc starter
set softtabstop=2 " 1 tab = 2 spaces
set expandtab " use spaces not tabs
set number " show line numbers
set showcmd " show commands in gutter
set cursorline " draw line on current line
set wildmenu " autocomplete for menu
set showmatch " highlight matching on brackets
set foldenable " show folds
@drewsmith
drewsmith / bklt.sh
Created August 20, 2017 02:12
debian backlight alias
echo "alias bklt='xrandr --output LVDS-1 --brightness $1'" >> ~/.bashrc
source ~/.bashrc
usage: bklt 0.75

Keybase proof

I hereby claim:

  • I am drewsmith on github.
  • I am drewsmith (https://keybase.io/drewsmith) on keybase.
  • I have a public key whose fingerprint is 3FDD 4D08 2790 D316 2085 8621 11D6 57BB 8951 64F5

To claim this, I am signing this object:

@drewsmith
drewsmith / choco_setup.bat
Last active August 2, 2016 14:25
Chocolatey Device Setup
@echo off
set PKGS=(GoogleChrome jdk8 jdk7 ruby git maven awscli chefdk virtualbox vagrant packer synergy SublimeText3 intellijidea-community mysql.workbench spotify slack HipChat)
set maven_OPTS=--version=3.3.9
SETLOCAL EnableDelayedExpansion
WHERE choco
IF %ERRORLEVEL% NEQ 0 (
CALL @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin