Text(talkModel.promptText)
.font(.title)
.padding()
.frame(maxWidth: .infinity)
.background(.ultraThinMaterial)
.foregroundColor(Color(UIColor.label))
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 argparse | |
import torch | |
from safetensors.torch import load_file | |
def save_checkpoint(weights, filename): | |
with open(filename, "wb") as f: | |
torch.save(weights, f) | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser() |
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
int LEFT = A0; | |
int RIGHT = A1; | |
int SERVO_MAX = 180.0; | |
int x_max; | |
int y_max; | |
Servo lt_servo; | |
Servo rt_servo; |
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
# Description: | |
# Control your nest thermostat. | |
# | |
# Commands: | |
# hubot how (warm|cold) is it - current temperature | |
# hubot it's warm - set the nest 1 degree Fahrenheit lower | |
# hubot it's cold - set the nest 1 degree Fahrenheit higher | |
# hubot nest status - current nest setting | |
# https://github.com/kasima/nesting |
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
Meteor.Router.add({ | |
'/posts': 'posts', | |
'/posts/:id': function(id) { | |
Session.set('postId'); | |
return 'post'; | |
}, | |
'/authors/:id': function(id) { | |
Session.set('authorId', id); | |
return 'author'; | |
} |
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
// From http://front-end-testing-talk.elabs.se/ | |
// Seen at RailsConf 2011 | |
// Typical jQuery | |
$('#whiskies li').each(function() { | |
var li = $(this); | |
var price = li.attr('data-price'); | |
var addLink = $('<a class="add-to-cart" href="#">Add to cart</a>'); | |
addLink.appendTo(li); |
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
class Parent | |
include Mongoid::Document | |
field :pants | |
field :shirts | |
embeds_many :children | |
end | |
class Child | |
include Mongoid::Document |
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
class DiagnosticReport | |
include Mongoid::Document | |
embeds_many :marker_values | |
end | |
class MarkerValue | |
include Mongoid::Document |
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
def escaped_unicode(s) | |
s.unpack("U*").map do |v| | |
if v == 10 | |
'\n' | |
elsif v < 256 | |
v.chr | |
else | |
'\u{'+v.to_s(16)+'}' | |
end | |
end.join |
NewerOlder