Skip to content

Instantly share code, notes, and snippets.

@safa-dayo
safa-dayo / sd-webui-google-colab-setup.sh
Last active May 4, 2024 02:33
Stable Diffusion web UI(最新版)をGoogle Colabで起動するためのコマンド。こちらのコマンドを自身のGoogle Colabノートブックにコピーした後、利用したいモデルや拡張機能、LoRAなどにチェックを入れた上で実行ボタンを押すことで、設定した内容でStable Diffusion web UIが起動します。
#@title Stable Diffusion web UI(最新版)をGoogle Colabで起動するためのコマンド
#@markdown ## このColabノートブックについて
#@markdown [Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) をGoogle Colabで起動するためのノートブックとなります。
#@markdown 利用したいモデルや拡張機能、LoRAなどにチェックを入れた上で実行ボタンを押すことで、設定した内容でStable Diffusion web UIが起動します。
#@markdown また各項目には公式ページへのリンクをつけています。利用の際は公式ページよりライセンスなどを確認した上でご利用ください。
### Stable Diffusion web UIインストール

JavaScript Interview Questions

Q1: Explain equality in JavaScript ☆

Answer: JavaScript has both strict and type–converting comparisons:

  • Strict comparison (e.g., ===) checks for value equality without allowing coercion
  • Abstract comparison (e.g. ==) checks for value equality with coercion allowed
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 4, 2024 02:26
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

//Attach to player object
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
public class Voice : NetworkBehaviour
{
int lastSample;
AudioClip c;
@JohnAtl
JohnAtl / check-nvidia-cuda
Created January 5, 2024 15:25
Distrobox with Tensorflow and Nvidia support
#!/bin/bash
# Adapted from https://stackoverflow.com/a/47436840
function lib_installed() { /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) 2>/dev/null | grep $1; }
function check() { lib_installed $1 && echo "$1 is installed" || echo -e "\nERROR: $1 is NOT installed\n"; }
check libcuda.so
check libcudart
check libcudnn
@brittonhayes
brittonhayes / kali_setup.sh
Last active May 4, 2024 02:21
Setup a new Kali Linux machine with my favorite flavors
#!/bin/bash
echo "GETTING STARTED..."
# Go Home
cd ~
# Create code environment
mkdir -p ~/Documents/code/workspace
mkdir -p ~/Documents/code/scripts
@ncalm
ncalm / excel-lambda-FREQ.SIMPLE.txt
Last active May 4, 2024 02:19
This Excel lambda function creates a simple frequency table for a single-column array
/*
FREQ.SIMPLE
Calculates a simple frequency table of the values in a column
Inputs:
1. data - a single column of data
*/
FREQ.SIMPLE = LAMBDA(data,
@ncalm
ncalm / excel-lambda-CORRELMATRIX.txt
Created June 1, 2022 18:28
This Excel lambda function calculates a correlation matrix for a range of data, optionally using either the Pearson or Spearman Ranked correlation
/*
CORRELMATRIX
Returns a correlation matrix
Inputs:
x - an array of 2:n numeric columns of equal size for which to calculate the correlation of each pair of 2 columns
has_header - TRUE if the first row of x contains column headers. If omitted or FALSE, x is assumed to not include a header row
ranked - if TRUE, calculate the Spearman Ranked Correlation Coefficient. If FALSE or omitted, calculate the Pearson Correlation Coefficient
*/
@odan
odan / nginx-php-windows-setup.md
Last active May 4, 2024 02:16
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

@igv
igv / adaptive-sharpen.glsl
Last active May 4, 2024 02:13
Optimal sharpening strength (according to objective metrics) - 0.5. Can be applied only to luma channel (change OUTPUT to LUMA). To use it on-demand add the following line to input.conf: n change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"
// Copyright (c) 2015-2021, bacondither
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// in this position and unchanged.
// 2. Redistributions in binary form must reproduce the above copyright