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
const container = document.createElement('dialog'); | |
function createDialog() { | |
const close = document.createElement('button'); | |
container.setAttribute('style', 'width: 100%;letter-spacing:1px;background-color:pink;font-family:helvetica !important;font-weight:100;border-radius:12px;padding-inline:60px;color:#161613;border-color:#fff;position:fixed;inset:0;margin:auto;width:100%;max-width:400px;z-index:2147483647;font-size:18px;text-rendering:optimizeLegibility;text-align:left;line-height:36px;'); | |
close.setAttribute('style', 'position:absolute;right:10px;top:8px !important;background-color:white;border-radius:50%;color:black;z-index:30;padding:0 0 0 1px;font-size:15px;font-weight:100;width:20px;height:20px;cursor:pointer;display:flex;justify-content:center;align-items:flex-start;border:1px solid black;line-height:16px;'); | |
close.textContent = 'x'; | |
close.onclick = () => container.remove(); |
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
/* | |
Raw Code | |
*/ | |
try { | |
const rightNow = new Intl.DateTimeFormat("en-US", { | |
year: "numeric", | |
month: "2-digit", | |
day: "2-digit", | |
hour: "2-digit", |
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
openWork() { | |
StartColor="\e[1;32m" | |
EndColor="\e[0m" | |
editor="code" # add command which opens files/dirs using your editor | |
workDirectory=(~/dev/) # add your path to your work directory | |
directories=($workDirectory*) | |
PS3="Enter the number associated with a directory you want to open with $editor? " | |
echo "There are ${StartColor}${#directories[@]}${EndColor} directories in ${StartColor}${workDirectory}${EndColor}:"; \ | |
select directory in "${directories[@]##*/}"; do echo "Opening ${StartColor}${directory}${EndColor}"' with '${StartColor}${editor}${EndColor}'!'; $editor $workDirectory${directory}; break; done | |
} |
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/bash | |
echo " | |
$(tput bold)$(tput smul)Bootstrap $(tput setaf 6)V3.3.7$(tput sgr0) | |
$(tput setaf 7)$(tput bold)Grid$(tput sgr0) | |
$(tput setaf 7)\$$(tput setaf 5)screen-xs-min $(tput setaf 7)= $(tput setaf 6)0 | |
$(tput setaf 7)\$$(tput setaf 5)screen-xs-max $(tput setaf 7)= $(tput setaf 6)767px | |
$(tput setaf 7)\$$(tput setaf 5)screen-sm-min $(tput setaf 7)= $(tput setaf 6)768px |
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
#!/usr/bin/env bash | |
# | |
# Bootstrap script for setting up a new OSX machine | |
# | |
# This should be idempotent so it can be run multiple times. | |
# | |
# Notes: | |
# | |
# - If installing full Xcode, it's better to install that first from the app | |
# store before running the bootstrap script. Otherwise, Homebrew can't access |
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
$('a').on('click', function(e) { | |
if($(this).attr('href') === '#') { | |
e.preventDefault(); | |
} | |
}); |
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
//https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript?page=1&tab=active#tab-top | |
let qd = {}; | |
if (location.href) { | |
let re = /(\#|\&)/; | |
location.href.substr(1).split(re).forEach(item => {let [k,v] = item.split("="); v = v && decodeURIComponent(v).replace(/\+/g, " "); (qd[k] = qd[k] || []).push(v)}) | |
} | |
//type qd into console to see all of the arrays created by script |
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
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set show-all-if-ambiguous on | |
set completion-ignore-case on |
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
filelist() { | |
if [ $# -gt 0 ]; then | |
shopt -s nullglob | |
for ext in "$@"; do | |
printf '%s\n' *.$ext | |
done | pbcopy | |
echo "copied listing for $@ files to clipboard" | |
else | |
shopt -s nullglob |
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
"BS3 Media Query Snippet": { | |
"prefix": "bs-media", | |
"body": [ | |
"@media ($minMax-width: \\$screen-$xsSmMdLg-$minMax) {\n\t$0\n}" | |
], | |
"description": "BS3 MediaQuery" | |
}, | |
"BS3 Media Query Self Only Snippet ": { | |
"prefix": "bs-media-only", | |
"body": [ |
NewerOlder