- What is RegExp
- Simple example vs advanced example
- Character groups
- Quantifiers
- Capture groups
- Re-visit simple example and break it down
- Re-visit advanced example and break it down
- How you can use it in your everyday life (Show how vsc can do regex searches to match all etc)
This file contains hidden or 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
// How to use: Login to trafikverket's boka prov site | |
// Fill in the towns you want to do the test in and the rest of the settings so you get an initial search | |
// Update the referenceDate option in the bottom to the latest date you want to search for (set this to your current booked time) | |
// Copy paste all the code in this file (ctrl + a + c) into the console of the trafikverket page | |
// Now it will change between no gear option and manual gear option every thirty seconds, which will cause a refresh of the search every 60 seconds | |
// If it finds a newer time than specified it will log a bunch of green checkboxes | |
// If it does NOT find a newer time than specified it will log a red checkbox | |
// If you manage to snag a newer time, just update the referenceDate variable to the new date and the script should automatically check against the new time | |
// If you want to check against automatic car times, just change '#vehicle-select option:nth-child(2)' to '#vehicle-select option:nth-child(3)' and it should work just as |
This file contains hidden or 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/sh | |
tmux new-session -n "Name of window 1" -s "dev" -c "/home/<User>/workspace" -d '<command to run e.g. nano file.txt>' | |
tmux new-window -n "Name of Window 2" -c "/home/<User>/workspace" '<command to run e.g. nano file.txt>' | |
tmux next-window # Selects the next window, since we're currently selecting the last window, the next window is the first window | |
tmux -2 a # now we attach to the newly created session using 256 color mode |
This file contains hidden or 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
#ifndef BINARYSEARCHTREE_H | |
#define BINARYSEARCHTREE_H | |
#include <iostream> | |
using namespace std; | |
template<typename AnyType> | |
class BinarySearchTree | |
{ | |
private: | |
class Node | |
{ |
This file contains hidden or 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 originalWords = "makes my dick hard"; | |
const wordArray = originalWords.split(" "); | |
function perm(xs) { | |
let ret = []; | |
for (let i = 0; i < xs.length; i = i + 1) { | |
let rest = perm(xs.slice(0, i).concat(xs.slice(i + 1))); | |
if (!rest.length) { | |
ret.push([xs[i]]) | |
} else { |
This file contains hidden or 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
// rotation variable is the rotation of the rect in radians | |
// rectWidth is the width of the rectangle in question | |
// rectX is the x position of the top left most corner of the rectangle | |
// rectY is the y position of the top left most corner of the rectangle | |
const rotatedXDelta = rectWidth * Math.cos(rotation); | |
const rotatedYDelta = rectWidth * Math.sin(rotation); | |
const rotatedX = rectX + rotatedXDelta; | |
const rotatedY = rectY + rotatedYDelta; |
Poerves [Support] (Captain) Twitch: https://www.twitch.tv/poerves
- Alexstraza (P:5 | W:2 | L:3)
- Whitemane (P:5 | W:2 | L:3)
- Deckard (P:1 | W:1 | L:0)
- Malfurion (P:1 | W:0 | L:1)
This file contains hidden or 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
javascript:(function() { | |
let d = new Date(); | |
let ch = d.getHours(); | |
let cm = d.getMinutes(); | |
let cY = d.getFullYear(); | |
let cM = d.getMonth(); | |
let cD = d.getDate(); | |
let cd = cY+"-"+cM+"-"+cD; |
This file contains hidden or 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
public findDistanceBetweenPoints(pointA, pointB) { | |
var a = pointA["x"] - pointB["x"] | |
var b = pointA["y"] - pointB["y"] | |
var length = Math.sqrt(a*a + b*b) | |
return length | |
} | |
public findSlope(pointA, pointB) { | |
var a = pointB["y"] - pointA["y"] |
This file contains hidden or 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
def find_diagonal_match(matrix, y, x, searchLeft=False): | |
negator = -1 if searchLeft else 1 | |
match = True | |
if len(matrix) < y+5 or (len(matrix[y]) < x+5 and x-5 > 0): | |
match = False | |
for i in range(1, 5): | |
if not match: | |
break | |
newX = x + (negator*i) | |
match = matrix[y+i][newX] == matrix[y][x] |
NewerOlder