Skip to content

Instantly share code, notes, and snippets.

View darthdeus's full-sized avatar

Jakub Arnold darthdeus

View GitHub Profile
@darthdeus
darthdeus / stable_diffusion_walk.py
Created August 23, 2022 13:58 — forked from nateraw/stable_diffusion_walk.py
Walk between stable diffusion text prompts
"""
Built on top of this gist by @karpathy:
https://gist.github.com/karpathy/00103b0037c5aaea32fe1da1af553355
stable diffusion dreaming over text prompts
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stable_diffusion_walk.py --prompts "['blueberry spaghetti', 'strawberry spaghetti']" --seeds 243,523 --name berry_good_spaghetti
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i dreams/berry_good_spaghetti/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p berry_good_spaghetti.mp4
nice slerp def from @xsteenbrugge ty
@darthdeus
darthdeus / min-char-rnn.py
Created March 16, 2018 17:09 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@darthdeus
darthdeus / gist:5303646
Last active December 15, 2015 18:28 — forked from joachimhs/gist:5303131
var alertAdminController;
module("EurekaJ.AdministrationAlertsController", {
setup: function() {
this.server = sinon.fakeServer.create();
Ember.run(function() {
alertAdminController = EurekaJ.__container__.lookup("controller:administrationAlerts");
});
var alertAdminController;
module("EurekaJ.AdministrationAlertsController", {
setup: function() {
this.xhr = sinon.useFakeXMLHttpRequest();
this.server = sinon.fakeServer.create();
var requests = this.requests = [];

I've been trying to do routing in Ember using something other than id. This is how I implemted a dasherized version of a post's title. I get the feeling that instead of the deserialize function I should be overwrite the model function as the guides suggest, but then I lose the symmetry I have with the serialize function.

If there's a better/more ember way, I'd love to know.

Thanks @darthdeus for teaching me about DS.LoadPromise

@darthdeus
darthdeus / init.coffee
Last active December 13, 2015 18:59 — forked from ohcibi/init.coffee
Ember.Handlebars.registerBoundHelper 'forMoreThanOneIn', (collection) ->
alert collection.toArray()
return elseFn() if collection.length == 1
return "Compound"
window.App = Ember.Application.create
rootElement: "#QiviconBasicClient"
App.Router.map -> @resource 'rooms'
App.IndexRoute = Ember.Route.extend redirect: -> @transitionTo 'rooms'
@darthdeus
darthdeus / gist:4706568
Last active December 12, 2015 03:28 — forked from jackkitley/gist:4706392
{{#linkTo catalogue.item item}
App.Router.map(function() {
this.resource('catalogue', function() {
// this.route('index'); - this is automatic
this.route('search', { path: ':searchvalue' });
this.route('item', {path: '/view/:itemguid'});
});
});
App.Router = Ember.Router.extend({
enableLogging: true,
root: Ember.Route.extend({
// Transitions
showModuleDocuments: Ember.Route.transitionTo('moduleDocuments'),
showModuleTask: Ember.Route.transitionTo('moduleTask'),
showSettings: Ember.Route.transitionTo('settings'),
showManagement: Ember.Route.transitionTo('management'),
showAdministration: Ember.Route.transitionTo('administration'),
window.App = Em.Application.create({
LOG_TRANSITIONS: true
});
App.deferReadiness();
App.Router.map(function() {
this.route("login", { path: "/login" });
this.route("explore", { path: "/explore" });
this.route("events", { path: "/events" });