Skip to content

Instantly share code, notes, and snippets.

from PIL import Image
import stable_inference
import numpy as np
from einops import repeat
# Interpolate video between two conditionings
FOLDER = 'test/painting'
MAX_STRENGTH = 0.5 # Strength at maximum in the middle of the interpolation
SEED = 9001
SECONDS = 10
from PIL import Image
import stable_inference
import numpy as np
from einops import repeat
'''
Interpolate between two images with a prompt of what you expect the midstate to be.
Alter the stuff below here to whatever you need it to be.
'''
@dabit3
dabit3 / marketplace.sol
Last active March 14, 2024 15:55
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {

How To Make A Working TWRP Device Tree For Your MediaTek Device & Start Building Them, Online

This Guide is tested on 64-bit mt6735/53 chipset device. It will also work on any 64-bit and 32-bit devices.

You will need something from your Stock ROM first. Get them all and Try to modify it using the procedure.

Note: This guide will be helpful for you if you have older mediatek devices (android-5.1 or android-6.0), but up-to-date devices can also work.

Update: This guide had a few typos and derps (Oops..), but I've tried to make it free of those now (Dated November 18, 2020)

Bonus: You can also use this tool by @SebaUbuntu, @yshalsager and @mauronofrio to auto generate the twrp tree. The tool is best if your device runs on android-9.0. The tools is still not 100% compatible to all devices, but I'll still recommend it and give it 8.5/10 in the scale of varsatility.

@CodeMyUI
CodeMyUI / comic-book-style-layout-with-css-grid.markdown
Created October 22, 2017 22:43
Comic book style layout with CSS Grid

Comic book style layout with CSS Grid

Going crazy again with Grid CSS. This one is done in 30 minutes so the code quality isn't that good. I brute force my way to get the layout right quickly by using the dev tools as well. Anyway, only works well on browsers with Grid AND Clip Path. For Clip Path, it should work with Firefox 54 and above because I don't use SVG to generate it. Older browsers will get a boring layout instead.

A Pen by Aysha Anggraini on CodePen.

License.

@ryanabel03
ryanabel03 / application-adapter.coffee
Created March 27, 2016 23:46
Ember.js Network Request Retries
ApplicationAdpater = DS.ActiveModelAdapter.extend
synchronizer: Em.inject.service()
ajax: (url, type, options) ->
hash = @ajaxOptions(url, type, options)
# set up hash.success & hash.error callbacks normally
@get('synchronizer').handleRequest(hash)
@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@teechap
teechap / heatmap_example.py
Created September 18, 2014 00:35
How to make a heatmap from data stored in Python lists
'''
Most heatmap tutorials I found online use pyplot.pcolormesh with random sets of
data from Numpy; I just needed to plot x, y, z values stored in lists--without
all the Numpy mumbo jumbo. Here I have code to plot intensity on a 2D array, and
I only use Numpy where I need to (pcolormesh expects Numpy arrays as inputs).
'''
import matplotlib.pyplot as plt
import numpy as np
#here's our data to plot, all normal Python lists
@bradwright
bradwright / private.xml
Last active August 29, 2015 14:00
KeyRemap4MacBook XML configuration for the Tarmak transitional layout
<?xml version="1.0"?>
<root>
<item>
<name>Tarmak transitional layout</name>
<!-- http://forum.colemak.com/viewtopic.php?pid=8786#p8786 -->
<item>
<name>Tarmak1(E) transitional layout (E&gt;K&gt;N&gt;J)</name>
<identifier>private.tarmak.tarmak_1_e</identifier>
<autogen>__KeyToKey__ KeyCode::K, KeyCode::E</autogen>
<autogen>__KeyToKey__ KeyCode::N, KeyCode::K</autogen>
@machty
machty / router-js-refactor-architecture.md
Last active July 31, 2019 18:39
Overview of the architecture and approach to the router.js refactor

router.js Architecture

Let this serve as a guide for anyone who'd like to dig into router.js's internals, understand what's going on, and hopefully contribute!

Scope of router.js (et al)

router.js is most popularly known as the routing microlib used by the Ember.js Router, though other folk have been known to use it beyond Ember, including some Angular folk who weren't satisfied with