Skip to content

Instantly share code, notes, and snippets.

View konecnyna's full-sized avatar
💭
wanging

defkon konecnyna

💭
wanging
View GitHub Profile
@konecnyna
konecnyna / amex.js
Last active September 17, 2021 17:40
const fun = `
(async () => {
const sleep = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout));
const btns = [...document.getElementsByClassName("btn")].filter( it => it.title === "Add to Card");
for (let i = 0; i < btns.length; i++) {
btns[i].click();
await sleep(1000);
}
})()
`;
@konecnyna
konecnyna / tv.sh
Created June 24, 2021 23:51
hdhomerun vlc cli
#!/usr/bin/env node
const { execSync } = require("child_process")
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const read = (question) => {
return new Promise(resolve => {
/** Adapted from https://codepen.io/pimskie/pen/jEVPNx **/
function Flake(x, y, maxSpeedConfig) {
const maxWeight = 5;
const maxSpeed = maxSpeedConfig || 3;
this.x = x;
this.y = y;
this.r = randomBetween(0, 1);
this.a = randomBetween(0, Math.PI);
this.aStep = 0.01;
@konecnyna
konecnyna / transmission_remove_finished.sh
Created April 22, 2021 12:52 — forked from pawelszydlo/transmission_remove_finished.sh
Script to clear finished torrents from transmission-daemon
#!/bin/bash
# Clears finished downloads from Transmission.
# Version: 1.1
#
# Newest version can always be found at:
# https://gist.github.com/pawelszydlo/e2e1fc424f2c9d306f3a
#
# Server string is resolved in this order:
# 1. TRANSMISSION_SERVER environment variable
// 1. Open https://robinhood.com/account/history
// 2. paste code into console
var parse = () => {
let csv = "Name,Action,Amount\n";
let sections = document.querySelectorAll("[class*=rh-expandable-item]")
let credit = 0;
let debit = 0;
let validActions = ["Buy", "Sell", "Expiration"]
@konecnyna
konecnyna / motion.js
Last active November 4, 2020 17:46
"dependencies": { "onoff": "latest" } || yarn add onoff
const Gpio = require('onoff').Gpio;
const exec = require('child_process').exec;
let started = false;
const config = {
sensorPin: 14,
sensorState: 1,
relayPin: false,
relayState: 1,
alwaysOnPin: false,
@konecnyna
konecnyna / wpa_supplicant.conf
Created August 2, 2020 22:19
touch ssh file on boot to enable ssh
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="TheChinaClub"
psk="testingPassword"
}
@konecnyna
konecnyna / scrape-finance.js
Last active March 9, 2020 20:31
Stocks Scrape
const request = require("request-promise");
const cheerio = require("cheerio");
const NUMBER_REGEX = "\\-?\\+?[0-9]{1,3}(,[0-9]{3})*(.[0-9]+)?";
const stockPriceRegex = () =>
new RegExp(
`Stock Price(?<price>${NUMBER_REGEX})\\s(?<day_change>${NUMBER_REGEX})\\s(?<day_percent>\\(?\\d+.\\d+%)`,
"gm"
);
const afterHoursStockPriceRegex = () =>
new RegExp(
ln -s "/Users/`whoami`/Google Drive/alfred/snippets" "/Users/`whoami`/Library/Application Support/Alfred/Alfred.alfredpreferences/snippets"
ln -s "/Users/`whoami`/Google Drive/alfred/themes" "/Users/`whoami`/Library/Application Support/Alfred/Alfred.alfredpreferences/themes"