Skip to content

Instantly share code, notes, and snippets.

View arielgk's full-sized avatar

Ariel Kuhn arielgk

  • Buenos AIres - Argentina
View GitHub Profile
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
# Written by jachiam
import argparse
import os.path as osp
import torch
@homuler
homuler / android-installer-for-unity.sh
Last active August 17, 2022 23:54
A script to work around a bug that for some reason prevents Android-related commands from being executable on Linux.
#!/bin/bash
# Android-related commands are somewhat not executable on Linux, so install them again.
# cf. https://forum.unity.com/threads/android-sdk-ndk-and-openjdk-arent-marked-with-executable-permission-on-linux.1238494/
UNITY_EDITOR_ROOT="/path/to/Unity/Hub/Editor"
UNITY_EDITOR_VERSION="2021.3.3f1"
DESTINATION_ROOT="${UNITY_EDITOR_ROOT}/${UNITY_EDITOR_VERSION}/Editor/Data/PlaybackEngines/AndroidPlayer"
ANDROID_OPEN_JDK_URL=http://download.unity3d.com/download_unity/open-jdk/open-jdk-linux-x64/jdk8u172-b11_4be8440cc514099cfe1b50cbc74128f6955cd90fd5afe15ea7be60f832de67b4.zip
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export function withAppContext<
P extends { appContext?: AppContextInterface },
R = Omit<P, 'appContext'>
>(
Component: React.ComponentClass<P> | React.StatelessComponent<P>
): React.SFC<R> {
return function BoundComponent(props: R) {
return (
@andy-berry-dev
andy-berry-dev / AbstractModel.php
Last active July 9, 2019 18:52
Changes required to Laravel to allow observing attached/detached events (https://github.com/laravel/framework/pull/14988#issuecomment-267717423)
<?php
use App\Extensions\Relations\BelongsToMany;
abstract class AbstractModel extends Model
{
/*
* This is copied AS IS from \Illuminate\Database\Eloquent\Model@belongsToMany but instead uses our own BelongsToMany class
*/
//
// Created by Nick Vance on 12/4/15.
// Modified by Ryan Reece on 11/14/16.
//
import AVKit
import XCDYouTubeKit
import TVMLKit
class YTPlayerViewController: AVPlayerViewController, AVPlayerViewControllerDelegate {
@mcnamee
mcnamee / bitbucket-pipelines.yml
Last active December 14, 2023 03:57
Bitbucket Pipelines - Deploy via FTP to shared hosting
# Installation ---
# 1. In Bitbucket, add FTP_USERNAME, FTP_PASSWORD and FTP_HOST as environment variables.
# 2. Commit this file (bitbucket-pipelines.yml) to your repo (in the repo root dir)
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initialize GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (see 'Installation' above) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:deploy-all)
@krambertech
krambertech / Component.jsx
Created July 2, 2016 10:44
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@veltman
veltman / README.md
Last active February 12, 2022 07:14
Animated dash

Animating a path's dashed stroke without JavaScript using stroke-dasharray and stroke-dashoffset. As long as you animate the offset to be equal to one full dash group (e.g. stroke-dasharray: 10,5 and stroke-dashoffset: -15), the animation will appear continuous.

Two caveats:

  1. You can only animate the dash "backwards" in this way, so you may need to reverse the path's direction for the desired effect.
  2. If the path is closed, you might get a tiny "seam" at the start/end of the path where the dash doesn't line up. To fix that, you can ensure that the dash group is a factor of the path length like in this example.
@nickv2002
nickv2002 / YouTubePlayerViaTVJS.swift
Last active October 21, 2021 06:19
Swift code to play YouTube videos on AppleTV tvOS via a TVJS call using XCDYouTubeKit
//
// Created by Nick Vance on 12/4/15.
// Copyright © 2015 ToWatchList. All rights reserved.
//
import AVKit
import XCDYouTubeKit
import TVMLKit
class YTPlayerViewController: AVPlayerViewController, AVPlayerViewControllerDelegate {
@rdtsc
rdtsc / app.css
Created March 17, 2015 03:48
NW.js Windows PDF Printing Demo
body {
font-family: sans-serif;
}
section {
margin-bottom: 40px;
}
h1 {
font-size: 20px;