Follow
Sep 23, 2018 · 4 min read
import requests | |
from parsel import Selector | |
# $("div.dd-image-box-caption").toArray().forEach((div)=>{console.log(div.textContent.trim())}); | |
data = """Sam & Max: Season 1 | |
Sam & Max: Season 2 | |
Puzzle Agent 1 | |
Puzzle Agent 2 | |
Bone - Episode 1 & Episode 2 |
/** | |
* class for limiting the rate of function calls. | |
* Thanks to Pat Migliaccio. | |
* see https://medium.com/@pat_migliaccio/rate-limiting-throttling-consecutive-function-calls-with-queues-4c9de7106acc | |
* @example let l = new limit(); let logMessageLimited = l.throttleAndQueue(msg => { console.log(msg); }, 500); | |
*/ | |
class limit{ | |
public callQueue = [] | |
/** |
import {exec} from 'child_process' | |
/** | |
* kills the process and all its children | |
* If you are on linux process needs to be launched in detached state | |
* @param pid process identifier | |
* @param signal kill signal | |
*/ | |
export function killAll(pid:number, signal:string|number='SIGTERM'){ | |
if(process.platform == "win32"){ |
import { spawn, ChildProcess } from "child_process" | |
child = spawn("command", ["argument"]) | |
child.kill() |
const vscode = require('vscode'); | |
const TelemetryReporter = require('vscode-extension-telemetry'); | |
// events are in format username/extensionId/action | |
const extensionId = '<your extension unique name>'; | |
const extension = extensions.getExtension(extensionId)!; | |
const extensionVersion = extension.packageJSON.version | |
// the application insights key |
======================================================== | |
= BACKSTORY | |
======================================================== | |
I got a new SSD for my windows 10 home desktop computer recently. I used macrium to clone the HDD -> SSD and changed bios to boot from SSD. | |
But when I tried cleaning the HDD I somehow corrupted something in the windows boot process (no idea how it happened, I never even touched my SSD). | |
When I start windows I get error code 0xc000000e (A required device isn't connected or can't be accessed), so I have to go into recovery mode. | |
Most people online fix this by using bootrec, or worst case scenario bootsect. Nothing works for me. |
alias logout="exit" | |
alias rm="rm -I" | |
alias cp="cp -i" | |
alias mv="mv -i" | |
alias users="cut -d : -f 1 /etc/passwd" | |
alias packages="dpkg --list" | |
alias programs="dpkg --list" | |
alias cwd=pwd | |
alias demons="ps -eo 'tty,pid,comm' | grep ^?" | |
alias daemons="ps -eo 'tty,pid,comm' | grep ^?" |
// Place your key bindings in this file to overwrite the defaults | |
[{ | |
"key": "ctrl+shift+f", | |
"command": "workbench.action.tasks.runTask", | |
"args": "npmRunStart" | |
}, | |
{ "key": "ctrl+shift+down", "command": "cursorColumnSelectDown", | |
"when": "editorTextFocus" }, | |
{ "key": "ctrl+shift+up", "command": "cursorColumnSelectUp", | |
"when": "editorTextFocus" }, |
from arepl_dump import dump | |
#$end | |
# The first part of programming is simply declaring your variables | |
# This is very similar to math | |
x = 1 | |
my_cool_number = 1+1 | |
# my cool number = 1+1 # this doesn't work, no spaces allowed! | |
z = 2*2 |
Follow
Sep 23, 2018 · 4 min read