Skip to content

Instantly share code, notes, and snippets.

@zaydek-old
zaydek-old / log (example)
Created February 5, 2018 17:51
Example of some source code: this quotes the stock market (e.g. <2k stocks) at one-second intervals for all unique quotes throughout the day
$ head AAPL
09:30:00.000 166.6400
09:30:02.000 166.3000
09:30:03.000 166.2400
09:30:04.000 166.2050
09:30:05.000 166.2900
09:30:06.000 166.1500
09:30:07.000 166.2450
09:30:08.000 166.0675
09:30:09.000 166.0200
@zaydek-old
zaydek-old / log (example)
Last active July 2, 2019 05:02
Example of some source code: this quotes the stock market (e.g. <2k stocks) at one-second intervals for all unique quotes throughout the day
$ head AAPL
09:30:00.000 166.6400
09:30:02.000 166.3000
09:30:03.000 166.2400
09:30:04.000 166.2050
09:30:05.000 166.2900
09:30:06.000 166.1500
09:30:07.000 166.2450
09:30:08.000 166.0675
09:30:09.000 166.0200
@zaydek-old
zaydek-old / bookmark.min.js
Last active May 28, 2024 19:18
A *simple* CSS debugger. To use, bookmark "Debug CSS" at https://zaydek.github.io/debug.css. Learn more here https://medium.freecodecamp.org/88529aa5a6a3 and https://youtu.be/2QdzahteCCs?t=1m25s (starts at 1:25)
/* debug.css | MIT License | zaydek.github.com/debug.css */ if (!("is_debugging" in window)) { is_debugging = false; var debug_el = document.createElement("style"); debug_el.append(document.createTextNode(`*:not(g):not(path) { color: hsla(210, 100%, 100%, 0.9) !important; background: hsla(210, 100%, 50%, 0.5) !important; outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; box-shadow: none !important; filter: none !important; }`)); } function enable_debugger() { if (!is_debugging) { document.head.appendChild(debug_el); is_debugging = true; } } function disable_debugger() { if (is_debugging) { document.head.removeChild(debug_el); is_debugging = false; } } !is_debugging ? enable_debugger() : disable_debugger();
@zaydek-old
zaydek-old / iter.sh
Last active April 26, 2018 18:42
iterate ul and li's in JavaScript (e.g. shopify.github.io/liquid/basics/introduction)
for url in $(pbpaste);
do open $url;
done
var names = document.getElementsByClassName("fullname ProfileNameTruncated-link u-textInheritColor js-nav");
for (name of names) {
console.dir(name);
}
var posts = document.getElementsByClassName("postArticle");
for (post of posts) {
console.log(post.children[1].children[0].href)
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello Bulma!</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.0/css/bulma.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.7/js/all.js"></script>
<style>
{
"workbench.statusBar.visible": false,
"explorer.openEditors.visible": 0,
"workbench.activityBar.visible": false,
"editor.minimap.enabled": false,
"workbench.colorTheme": "Coffee (rainglow)",
"editor.tabCompletion": true,
"editor.fontSize": 14,
"editor.fontFamily": "Monaco, Menlo, 'Courier New', monospace",
"workbench.editor.showTabs": false,
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--domains trapezekaely.com \
--no-parent \
http://trapezekaely.com
var names = document.getElementsByClassName("stream-item-content clearfix stream-item-activity stream-item-retweet stream-item-activity-notification");
var accs = names[0].children[0].children[0].children[1].children[0].children;
for (i = 0; i < accs.length; i++) {
console.dir(accs[i].children[0].href);
}