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 torch | |
from diffusers import LCMScheduler | |
from diffusers import DiffusionPipeline, UNet2DConditionModel | |
from huggingface_hub import hf_hub_download | |
from safetensors.torch import load_file | |
class TimestepShiftLCMScheduler(LCMScheduler): | |
def __init__(self, *args, shifted_timestep=250, **kwargs): | |
super().__init__(*args, **kwargs) |
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
// creates a graph representation of the input list | |
function createRelationshipGraph(inputList, idsOnly) { | |
const graph = {}; | |
inputList.forEach(curNode => { | |
const { id: curId, parent_id: parentId } = curNode; | |
const parentDoesNotExist = typeof graph[parentId] === "undefined"; | |
const curDoesNotExist = typeof graph[curId] === "undefined"; | |
const parentIsTopLevel = parentId === null; |
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
<script> | |
/** | |
* Provides a fake analytics object that sends all calls to the parent window for processing | |
*/ | |
var analytics = (function() { | |
var eventQueue = []; | |
// Send the events to the frame if it's ready. | |
function flush(method, args) { | |
while (eventQueue.length) { |
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
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
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
cd ~ | |
# app deps | |
sudo yum -y install git | |
# erlang deps | |
sudo yum -y groupinstall "Development Tools" | |
sudo yum -y install ncurses-devel | |
sudo yum install -y fop | |
sudo yum install -y openssl-devel |
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
#!/bin/sh | |
# script to convert mysql schema to be compatible with data warehouse software | |
# make sure that s3cmd and maatkit utility is installed | |
db_name=${1:-'test'} | |
> /root/$db_name.txt | |
temppath='/mnt/data/pdump1' | |
host='localhost' | |
user='maatkit' |
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
# Remove this for Arel v7.0 | |
module Arel | |
module Nodes | |
class Case < Arel::Nodes::Node | |
include Arel::OrderPredications | |
include Arel::Predications | |
include Arel::AliasPredication | |
attr_accessor :case, :conditions, :default |
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
#!/bin/bash | |
sudo rm -Rf /Applications/VMware\ Fusion.app | |
sudo rm -Rf /Library/Application\ Support/VMware | |
sudo rm -Rf /Library/Application\ Support/VMware\ Fusion | |
sudo rm -Rf /Library/Preferences/VMware\ Fusion | |
rm -Rf ~/Library/Application\ Support/VMware\ Fusion | |
rm -Rf ~/Library/Caches/com.vmware.fusion | |
rm -Rf ~/Library/Preferences/com.vmware.fusion* |
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
#!/bin/bash | |
OUT=$1 | |
shift | |
# Usage: ./mergepdf OUTPUT file1 file2 file3 ... | |
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$OUT $@ |
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
let module = macro { | |
case {_ | |
$name | |
import $params (,) ... | |
} => { | |
letstx $name_str = [makeValue(unwrapSyntax(#{$name}), #{here})]; | |
return #{ | |
angular.module($name_str, [$params (,) ...]) | |
}; | |
} |
NewerOlder