Skip to content

Instantly share code, notes, and snippets.

@weisk
weisk / 55-bytes-of-css.md
Created September 25, 2022 20:46 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
->Setting processData to false lets you prevent jQuery from automatically transforming the data into a query string.
And Setting the contentType to false is imperative.
Refference link: https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
//01// File Upload using FormData Object in Javascript
Syntax:
var formData = new FormData(); // Currently empty
formData.append(name, value); // custom text field where key/value pair
formData.append(name, value, filename); // Custom file uploading
@weisk
weisk / script.sh
Created April 9, 2021 03:20 — forked from xphere/script.sh
Bash script skeleton
#!/bin/bash
settings() {
SCRIPT_DIR="$(dirname "$0")"
}
main() {
request $@
settings
run
@weisk
weisk / email_parse_url.py
Created April 1, 2021 05:32 — forked from aptgetupgrade/email_parse_url.py
code to poll emails from an IMAP email server and post these to wallabag
# Read email in inbox, look for any URLs and update them to wallabag, delete email if URLs found in it.
# Built from various internet sources. Final code donated under GPL v3 by Github user aptgetupgrade
# Tested using python 2. Could be run as part of a crontab, e.g. every 5 mins.
#
import sys
import imaplib
import getpass
import email
import email.header
import datetime
@weisk
weisk / README.md
Created March 24, 2021 15:26 — forked from mdp/README.md
Clone/Sync all gists

Clone all your gists

Stolen from mbostok and improved upon

node cloneAllGists.js username token [outputDir]

@weisk
weisk / notes.md
Created March 24, 2021 01:38 — forked from routeback/notes.md
SEC487 Notes
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
@weisk
weisk / delete_git_submodule.md
Created March 15, 2021 03:05 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@weisk
weisk / certbot_reverse_proxy_guide.md
Created February 24, 2021 03:56 — forked from Juul/certbot_reverse_proxy_guide.md
How to use Let's Encrypt / certbot with a reverse proxy

apache config

The secret sauce is:

<Location /.well-known>
    ProxyPass !
</Location>
@weisk
weisk / MS Perks & Benefits.md
Created February 24, 2021 03:38 — forked from Teino1978-Corp/MS Perks & Benefits.md
Summary of any and all perks when working with Microsoft.

##Perks of Microsoft

####Salary

####Health and Wellness Care

  • Medical and hospitalization: Two choices for medical insurance. Both with no premium but different deductibles.
    • The two choices on medical plans are a high-deductible health plan (Microsoft puts a chunk of money into the Health Savings Account for you, which covers most of the deductible) and an HMO.
  • With the HMO, you pay basically nothing as long as you only go to Group Health doctors. With the high-deductible plan, you're covered under the local Blue Cross provider which means you can go to just about any doctor in the country. For