PS > Get-ChildItem -File -Recurse | % { $x = get-content -raw -path $_.fullname; $x -replace "`r`n","`n" | set-content -path $_.fullname }
PS > Remove-Item -Recurse -Force
/** Taken from Andrew Burgess YT video */ | |
// https://www.youtube.com/watch?v=_1mQ_A7fq-g | |
function logged< | |
This, | |
Args extends any[], | |
Return, | |
Fn extends (this: This, ...args:Args) => Returns> | |
( | |
target: Fn, |
// Place your key bindings in this file to override the defaults | |
[ | |
// -- GENERAL SETUP | |
// | |
// I hate lru tab switching. Use `ctrl+p+p` for that. | |
{ | |
"key": "ctrl+tab", | |
"command": "workbench.action.nextEditor" | |
}, | |
{ |
I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.
The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.
You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.
<?php | |
class HashSet | |
{ | |
// PHP arrays are organized trees under the hood, also php provides better api's for dealing with keys. | |
// Hence we will use an arrays use it's keys for storing our nodes. Note PHP Arrays are always associative arrays. | |
private $set = []; | |
public function __construct($keys = []) |
#!/usr/bin/env bash | |
# Script to update dart-sass from official github release. | |
# Copyright (C) 2021 Abhinav Kulshreshtha | |
# Changelog | |
# 26th january 2024 fix for new URL format and recommended binary path practice. | |
# 05th october 2021 "updated with proper url" |
#!/usr/bin/env bash | |
# shellcheck disable=SC2034,SC2086,SC2155,SC2001,SC2048 | |
# | |
# Search file contents (by file extension) for the specified search term. | |
# | |
# grep options: | |
# | |
# -i Perform case insensitive matching. | |
# −r Recursively search subdirectories listed. |
# https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps/1330590#1330590 | |
# https://www.linuxuprising.com/2019/04/how-to-remove-old-snap-versions-to-free.html | |
#!/bin/bash | |
# Removes old revisions of snaps | |
# CLOSE ALL SNAPS BEFORE RUNNING THIS | |
set -eu | |
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do |
// Kotlin have sumBy:Int and sumByDouble:Double but many of us work with Long which is missing. | |
// This is an implementation based on stdlib for sumbydouble | |
// Save this in your util to make this accessable. | |
inline fun <T> Iterable<T>.sumByLong(selector: (T) -> Long): Long { | |
var sum = 0L | |
for (element in this) { | |
sum += selector(element) | |
} | |
return sum | |
} |
package com.example.simplenetwork; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.LinkProperties; | |
import android.net.Network; | |
import android.net.NetworkCapabilities; | |
import android.net.NetworkRequest; | |
import android.util.Log; |