Skip to content

Instantly share code, notes, and snippets.

View ChristianGrimberg's full-sized avatar
:octocat:
Happy coding!

Christian Grimberg ChristianGrimberg

:octocat:
Happy coding!
  • Avellaneda, Buenos Aires, Argentina
View GitHub Profile
@victor-pogor
victor-pogor / wsl.sh
Created October 3, 2020 17:31
This shell script is used for adding SSH and GPG keys to newly created WSL (Ubuntu) distribution.
#!/usr/bin/env bash
# Sensitive informations
FULLNAME='Name Surname' # Enter your fullname.
EMAIL='name.surname@example.com' # Enter your email.
GITHUB_TOKEN='xxxxx' # Enter your Github token. It can be obtained here: https://github.com/settings/tokens. You need to define the "admin:gpg_key" and "admin:public_key" scopes.
GPG_PASSPHRASE="xxxxx" # Enter GPG passphrase.
# Configure Git
git config --global user.name "$FULLNAME"
[wsl2]
memory=4GB # Limits VM memory in WSL 2 to 4 GB
processors=5 # Makes the WSL 2 VM use two virtual processors
Function Get-Sum {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[int] $Number1,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[int] $Number2
@fedme
fedme / Run Visual Studio Code for Linux from WSL.md
Last active November 8, 2023 09:33
Run Visual Studio Code for Linux from WSL on Windows 10

Run Visual Studio Code for Linux from WSL

Thanks a lot to mredbishop and others for their insturctions posted here. This is just a recap of what they figured out.

This process was tested on WSL Ubuntu 18.04.

Install VcXsrv on Windows

  1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
  2. Install the software on Windows

Add VS Code repositories

@victor-perez
victor-perez / git.bat
Last active June 5, 2025 20:47
Use WSL git inside VS Code from Windows 10 17046
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::this also support calls that contains a absolute windows path
::check of one of the params contain a absolute windows path
echo.%* | findstr /r /c:"[a-z]:[\\/]" > nul
if %errorlevel% == 1 (
::if not just git with the given parameters
call :git %*
@merken
merken / MyDbContext.cs
Last active March 8, 2021 13:46
Providing a connection string in EF core
public class MyDbContext : MyContext
{
private readonly string connectionString;
public MyDbContext(string connectionString) : base()
{
this.connectionString = connectionString;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
# We cloned our project to C:\sc\PSStackExchange
$ModuleName = 'PSmodName'
$Path = "$env:HOMEPATH\scripts\$($ModuleName)"
$Author = 'EricJayStevens'
$Description = 'PowerShell module to ...'
$version = $PSVersionTable.PSVersion | select -ExpandProperty Major
# Create the module and private function directories
mkdir $Path\$ModuleName
mkdir $Path\$ModuleName\Private
@PurpleBooth
PurpleBooth / README-Template.md
Last active January 10, 2026 20:34
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Wallpapers

Install with git git clone https://gist.github.com/85942af486eb79118467.git ~/Pictures/wallpapers

@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created October 3, 2014 11:40
install chrome from powershell
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec