pattern | description |
---|---|
(?=subexp) | look-ahead |
(?!subexp) | negative look-ahead |
(?<=subexp) | look-behind |
(? |
This file contains 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
import urllib.request | |
url = 'https://www.somewebsite.com/somefile' | |
req = urllib.request.Request(url, method='HEAD') | |
res = urllib.request.urlopen(req) | |
filename = res.info().get_filename() | |
urllib.request.urlretreve(url, f"/target/dir/{filename}") |
This file contains 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
# fatal: No configured push destination | |
# # Remote #local:#remote branch | |
git push --set-upstream https://github.com/username/repo.git master:master | |
# use `--force` flag on conflict |
This file contains 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
#include<iostream> | |
using namespace std; | |
extern "C" void examplefunction(double arg1); | |
int main(void) { | |
examplefunction(100); | |
} | |
void examplefunction(double arg1) { |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <ctype.h> | |
#include <curl/curl.h> | |
void fetch_web_data(struct web_data *chunk, char *address); | |
static size_t write_mem(void *contents, size_t size, size_t n, void *userp); |
This file contains 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
#include <stdio.h> | |
int egcd(int a, int b, int *x, int *y) { | |
if (a == 0) { | |
*x = 0; | |
*y = 1; | |
return b; | |
} |
This file contains 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
#include <iostream> | |
struct CD { | |
int trackNumber; | |
CD * nextSong; | |
CD(int selection, CD * track) { | |
trackNumber = selection; | |
nextSong = track; | |
} | |
}; |
This file contains 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
$Folder = 'C:\path\to\media\'; | |
$sec = 0 | |
$min = 0 | |
$hr = 0 | |
$len = @() | |
Get-ChildItem -Recurse | ForEach-Object { | |
$File = $_.Name; |
NewerOlder