-
Roll-your-own lazy singleton
public final class Single { private static Single INSTANCE; private Single() {}
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Write-AnsiHyperlink { | |
<# | |
.SYNOPSIS | |
Creates an ANSI Hyperlink in a supported terminal such as Windows Terminal 1.4 | |
#> | |
[CmdletBinding()] | |
param( | |
#The Uri that you wish to have as part of the hyperlink | |
[Parameter(Mandatory,ValueFromPipeline)][UriBuilder]$Uri, | |
#The label text that will actually be shown in Windows Terminal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Colorable Grid</title> | |
<style> | |
#grid-container { | |
display: grid; | |
grid-template-columns: repeat(5, 5px); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, time | |
from threading import Thread | |
from websocket import create_connection, WebSocketConnectionClosedException | |
def main(): | |
ws = None | |
thread = None | |
thread_running = False | |
thread_keepalive = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Colorable Grid</title> | |
<style> | |
#grid-container { | |
display: grid; | |
grid-template-columns: repeat(5, 5px); |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math' as math; | |
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
class OutlinedInputBorder extends InputBorder { | |
/// Creates a rounded rectangle outline border for an [InputDecorator]. | |
/// | |
/// If the [borderSide] parameter is [BorderSide.none], it will not draw a | |
/// border. However, it will still define a shape (which you can see if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Colorable Grid</title> | |
<style> | |
#grid-container { | |
display: grid; | |
grid-template-columns: repeat(5, 5px); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Colorable Grid</title> | |
<style> | |
#grid-container { | |
display: grid; | |
grid-template-columns: repeat(5, 5px); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Colorable Grid</title> | |
<style> | |
#grid-container { | |
display: grid; | |
grid-template-columns: repeat(5, 5px); |
NewerOlder