Skip to content

Instantly share code, notes, and snippets.

@dkorobtsov
dkorobtsov / Add_WindowsDefender_Exclusions.ps1
Last active May 9, 2024 02:10
PowerShell script to add Windows Defender exclusions for WSL2 and JetBrains IDE performance issues
# PowerShell script to add Windows Defender exclusions for WSL2 and JetBrains IDE performance issues
#
# For context please read this thread:
# https://github.com/microsoft/WSL/issues/8995
#
# How to use?
# - Save the Script: Open a text editor like Notepad and paste the PowerShell script into it.
# - Save the file with a .ps1 extension, for example, Add_WindowsDefender_Exclusions.ps1.
# - Run PowerShell as Administrator: Search for "PowerShell" in the Start menu, right-click on it, and choose "Run as administrator".
# - Navigate to the Script's Location: Use the cd command to navigate to the directory where you saved the .ps1 file.
@BeattieM
BeattieM / API Contract Example Spec.md
Last active May 9, 2024 02:10
An example of an API contract between the server and front-end devices

#Users

  • User object
{
  id: integer
  username: string
  email: string
  created_at: datetime(iso 8601)
  updated_at: datetime(iso 8601)
}
@greyltc
greyltc / launch-GRD.sh
Last active May 9, 2024 02:06
configures then activates gnome-remote-desktop from the command line
#!/usr/bin/env bash
# run this on the remote terminal machine, as auser with sudo powers, probably through a remote ssh shell
# this will overwrite all the settings it touches
# the name of the user to run these commands as
TARGET_USER=jane
# we need an inlocked desktop session. we can either start a new autologin one or unlock an existing one
@Querijn
Querijn / ddragon_example.js
Last active May 9, 2024 02:04
Get Champion by key or by ID with the latest DDragon version (Javascript)
let championByIdCache = {};
let championJson = {};
async function getLatestChampionDDragon(language = "en_US") {
if (championJson[language])
return championJson[language];
let response;
let versionIndex = 0;
@notnotrobby
notnotrobby / cgp.md
Last active May 9, 2024 02:04
List of free resources to study computer graphics programming.
@tatsuyasusukida
tatsuyasusukida / !README-javascript-media-video.md
Last active May 9, 2024 02:01
🎥 How to record a video with JavaScript [demo video available]

🎥 How to record a video with JavaScript [demo video available]

Demo video: How to record a video with JavaScript

About this article

This article describes how to shoot a video from JavaScript using the MediaStream Recording API. The related resources are shown below.

@cceddie
cceddie / gct-applescript-0.2
Created November 30, 2012 09:05
get Chrome tabs, write to executable bash file
-- gct: get chrome tabs
-- save FRONTMOST WINDOW of Chrome (or safari, but definitely not firefox) tabs into a file
-- optionally (by uncommenting) CLOSE the window
-- modified from http://www.leancrew.com/all-this/2012/10/saving-browser-tab-sets/
-- ------------------------------------------------------------
-- cce
-- 2012 nov- rev 0.2
-- - why do i punish myself with applescript?
--
-- ------------------------------------------------------------
@stephancasas
stephancasas / AdvancedToolbarWindow.swift
Last active May 9, 2024 01:58
A SwiftUI-compatible window for macOS with advanced toolbar configurability.
//
// AdvancedToolbarWindow.swift
//
// Created by Stephan Casas on 3/17/23.
//
import SwiftUI;
import AppKit;
class AdvancedToolbarWindow<MainContent: View, ToolbarContent: View, TitleToolbarContent: View>: NSWindow, NSToolbarDelegate {
@enikidis
enikidis / in.elastic
Last active May 9, 2024 01:58
Modified elastic constnat for tetragonal
# Compute elastic constant tensor for a crystal
#
# Written by Aidan Thompson (Sandia, athomps@sandia.gov)
#
# ---------------------------------------------------------------------------------------------
# The editor of this script is Nikidis Efstratios, a member of the COSSPHY lab in the Physics
# department, Solid State Section, Aristotle University of Thessaloniki.
# Date: 2023-5-8
# ---------------------------------------------------------------------------------------------
# This script uses the following three include files.
@mwufi
mwufi / install_docker_in_colab.sh
Last active May 9, 2024 01:54
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources