Skip to content

Instantly share code, notes, and snippets.

@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",
@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
{
@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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>HTML inputmode attribute</title>
<style>
* {
padding: 0;
@Dirack
Dirack / nautilusScript.md
Created July 25, 2019 22:36
Como criar um script do nautilus para abrir um terminal na pasta atual da janela aberta do nautilus

Create a script called Terminal (yes, without a extension) inside the folder ~/.local/share/nautilus/scripts with the following content:

#!/bin/sh
gnome-terminal

Make it executable, then close any Nautilus instance:

@ScottHutchinson
ScottHutchinson / install-vsix.ps1
Last active April 12, 2025 09:57
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)"
@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;
}),
@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 
{
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active April 25, 2025 18:21
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",
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Globalization;
public static partial class StringExtensions
{
public static sbyte ToSByte(this string s)
{