Skip to content

Instantly share code, notes, and snippets.

@ScottHutchinson
ScottHutchinson / install-vsix.ps1
Last active May 3, 2024 21:48
PowerShell scripts for batch installing Visual Studio extensions
# Based on http://nuts4.net/post/automated-download-and-installation-of-visual-studio-extensions-via-powershell
param([String] $PackageName)
$ErrorActionPreference = "Stop"
$baseProtocol = "https:"
$baseHostName = "marketplace.visualstudio.com"
$Uri = "$($baseProtocol)//$($baseHostName)/items?itemName=$($PackageName)"
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active May 1, 2024 09:36
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@bmaupin
bmaupin / tiling-extensions-for-gnome.md
Last active March 3, 2024 09:47
Tiling extensions for Gnome

Goal: find a Linux alternative to FancyZones for Windows

Name Recommended Type Supports main colum Supports layouts Multiple windows in same tile Windows can span multiple zones Notes
gSnap 👍👍 Gnome extension yes yes yes yes Can be configured almost just like FancyZones; in the settings:
  • disable Show tabs
  • enable Hold CTRL to snap windows
gTile Gnome extension no?
Tiling Assistant 👍 Gnome extension yes yes yes yes Layout support is "experimental" and the UX is a bit unintuitive; after enabling layouts, you have to click the star icon beside a layout to mark it as a favourite before you can then hold Alt while dragging
@RobsonFaxas
RobsonFaxas / snakeCase.cs
Last active February 26, 2024 22:15
[ASP.NET Core TW - EF Core case insensitive SnakeCase] tornar tabelas geradas pelo EF Core NamesToSnakeCase #DotNetCore
// 2 classes de métodos de extensão: StringExtensions e ModelBuilderExtensions
// 1 - String Extensions
using System.Text.RegularExpressions;
using Microsoft.EntityFrameworkCore;
namespace HelloWorldAspNetCore.Extensions
{
public static class StringExtensions
{
@ChrisTitusTech
ChrisTitusTech / fixlocale.sh
Created October 27, 2020 21:51
Fix Locales in any distro
#!/bin/bash
echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf
sudo locale-gen en_US.UTF-8
@cereme
cereme / HtmlClipboard.py
Created March 26, 2020 06:33
Copy HTML to clipboard in Windows32
"""
https://stackoverflow.com/a/60024346/6521523
Edit on Jan 02, 2020
@author: the_RR
Adapted for python 3.4+
Requires pywin32
original: http://code.activestate.com/recipes/474121/
# HtmlClipboard
# An interface to the "HTML Format" clipboard data format
@schauhan232
schauhan232 / HttpClientExtensions.cs
Last active March 21, 2023 11:06
Http Extension methods/Http Helper to get Response/ Request serialized and detribalized
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@alanorth
alanorth / iso3166-1.json
Created July 31, 2020 13:09
ISO 3166-1 JSON from iso-codes
{
"3166-1": [
{
"alpha_2": "AW",
"alpha_3": "ABW",
"name": "Aruba",
"numeric": "533"
},
{
"alpha_2": "AF",
@mul14
mul14 / README.md
Last active February 10, 2023 00:55
Simple Laravel Search Trait

Usage

Put SearchTrait.php in app directory. Then use SearchTrait in your model, like so

use App\SearchTrait;
use Illuminate\Database\Eloquent\Model;

class Article extends Model 
{
@motss
motss / LitElement_mobx.ts
Last active January 14, 2023 21:18
Best of both worlds: lit-element + mobx
import { html, LitElement } from 'https://unpkg.com/lit-element@latest/lit-element.js?module';
import { observable, action, autorun, reaction } from 'https://unpkg.com/mobx@latest/lib/mobx.es6.js?module';
const store = observable({
title: 'Hello, World!',
count: 0,
incrementCount: action(() => {
store.count += 1;
}),