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
#!/bin/sh | |
branch="$(git rev-parse --abbrev-ref HEAD)" | |
if [ "$branch" = "master" ]; then | |
echo "You can't commit directly to master branch" | |
exit 1 | |
fi | |
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
FROM rust:latest | |
RUN apt update && apt upgrade -y | |
RUN apt install -y g++-mingw-w64-x86-64 | |
RUN rustup target add x86_64-pc-windows-gnu | |
RUN rustup toolchain install stable-x86_64-pc-windows-gnu | |
WORKDIR /app |
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
using System; | |
using System.Net; | |
using System.Net.NetworkInformation; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
foreach ( NetworkInterface netif in NetworkInterface.GetAllNetworkInterfaces() ) | |
{ |
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 <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <arpa/inet.h> | |
int main(int argc, char **argv) | |
{ | |
if (argc < 2) |
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
def is_match(text, pattern): | |
assert text != None | |
assert pattern != None | |
assert isinstance(text, str) | |
assert isinstance(pattern, str) | |
T, P = len(text), len(pattern) | |
def _is_match(ti, pi): | |
if pi == P: |
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
from sys import argv | |
print(len(argv)) | |
print(argv) |
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
# Basic Autocompleter for git | |
# Covers most usecases | |
Register-ArgumentCompleter -CommandName "git" -Native -ScriptBlock { | |
param($wordToComplete, $commandAst, $cursorPosition) | |
$cmd = $commandAst.ToString() -split " " | |
# order is based on "popularity" | |
$supportedCommands = @("checkout", "add", "commit", "branch", "status", "pull", "push", "merge", "log", "stash") | |
$comps = @() | |
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
# In a PS terminal, type "code $profile" and put this in there | |
function killall { | |
param( | |
[ArgumentCompleter( | |
{ | |
param($cmd, $param, $values) | |
get-process | | |
? { $_.Name.StartsWith($values, [StringComparison]::OrdinalIgnoreCase) } | | |
Sort -Unique Name | |
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
# Copy and paste this in a Powershell window. Enter the userId at the prompt. Follow instruction below to get your userId | |
# download all PlaysTv videos of a user | |
# To find the user id, navigate to the your profile while logged in (IMPORTANT!) | |
# View source of the page, In the <html> tag there's data-conf attribute. | |
# The json in there will have the user id under [login_user.id] | |
function Safe-Title { | |
param ( | |
$Description, | |
$EpochMilliseconds |
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
{ | |
"background": "#282A36", | |
"black": "#21222C", | |
"blue": "#F1FA8C", | |
"brightBlack": "#6272A4", | |
"brightBlue": "#D6ACFF", | |
"brightCyan": "#A4FFFF", | |
"brightGreen": "#69FF94", | |
"brightPurple": "#FF92DF", | |
"brightRed": "#FF6E6E", |
NewerOlder